private void SendBatchToQueue(QueueMessage msg) { //mailhost MailerHost host = null; if (!MailerManager.Channels.TryGetValue(msg.Host, out host)) { throw new MessageException(MessageState.InvalidMessageHost, "Mailer host not exists :" + msg.Host); } if ((int)msg.Priority > (int)Priority.Normal)// (item.Segments > 0 && (int)item.Priority > (int)Priority.Normal) { SendDirectToQueue(msg); return; } string path = host.GetBatchPath(msg.Headers.Get <int>("BatchId")); MailerHost.EnsureDirectory(path); msg.Save(path); }