public static void Submit(SendAction sendAction, string host, int port, NetworkCredential credentials) { if (string.IsNullOrEmpty(host) || port == 0) { throw new SmtpServerInfoMissingException(); } using (SmtpTalk smtpTalk = new SmtpTalk(SmtpClientHelper.DebugOutput)) { smtpTalk.Connect(host, port); smtpTalk.Ehlo(); smtpTalk.StartTls(false); smtpTalk.Ehlo(); smtpTalk.Authenticate(credentials, SmtpSspiMechanism.Login); smtpTalk.MailFrom("<" + credentials.UserName + ">", null); foreach (string str in sendAction.Recipients) { smtpTalk.RcptTo("<" + str + ">", null); } byte[] data = sendAction.Data; using (MemoryStream memoryStream = new MemoryStream(data.Length)) { memoryStream.Write(data, 0, data.Length); memoryStream.Position = 0L; smtpTalk.Chunking(memoryStream); } smtpTalk.Quit(); } }
void IReplayProvider.Send(SendAction action) { MrsTracer.Provider.Function("ImapSourceMailbox.Send({0})", new object[] { action }); SmtpClientHelper.Submit(action, base.SmtpParameters.Server, base.SmtpParameters.Port, base.AuthenticationParameters.NetworkCredential); }
void IReplayProvider.Send(SendAction action) { MrsTracer.Provider.Function("EasSourceMailbox.Send({0})", new object[] { action }); string mimeString = null; using (MemoryStream memoryStream = new MemoryStream(action.Data)) { using (StreamReader streamReader = new StreamReader(memoryStream, Encoding.UTF8)) { mimeString = streamReader.ReadToEnd(); } } string clientId = EasSourceMailbox.ClientIdFromItemId(action.ItemId); base.EasConnectionWrapper.SendMail(clientId, mimeString); }