Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ SendMail()

MailWriter System.Net.Mail.SmtpTransport.SendMail ( MailAddress sender,
MailAddressCollection recipients,
string deliveryNotify,
bool allowUnicode,
out SmtpFailedRecipientException exception )
inlinepackage

Definition at line 199 of file SmtpTransport.cs.

200 {
201 if (sender == null)
202 {
203 throw new ArgumentNullException("sender");
204 }
205 if (recipients == null)
206 {
207 throw new ArgumentNullException("recipients");
208 }
209 MailCommand.Send(_connection, SmtpCommands.Mail, sender, allowUnicode);
211 exception = null;
212 foreach (MailAddress recipient in recipients)
213 {
214 string smtpAddress = recipient.GetSmtpAddress(allowUnicode);
215 string to = smtpAddress + (_connection.DSNEnabled ? deliveryNotify : string.Empty);
216 if (!RecipientCommand.Send(_connection, to, out var response))
217 {
219 }
220 }
222 {
224 {
226 }
227 else
228 {
230 }
232 {
233 exception.fatal = true;
234 throw exception;
235 }
236 }
237 DataCommand.Send(_connection);
238 return new MailWriter(_connection.GetClosableStream(), encodeForTransport: true);
239 }
void Add(TKey key, TValue value)
SmtpReplyReaderFactory Reader
readonly List< SmtpFailedRecipientException > _failedRecipientExceptions

References System.Net.Mail.SmtpTransport._connection, System.Net.Mail.SmtpTransport._failedRecipientExceptions, System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.Collections.Generic.Dictionary< TKey, TValue >.Clear(), System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.exception, System.Net.Mail.SmtpConnection.GetClosableStream(), System.Net.Mail.SmtpCommands.Mail, System.Net.Mail.SmtpConnection.Reader, System.Net.Mail.DataCommand.Send(), System.Net.Mail.MailCommand.Send(), System.Net.Mail.RecipientCommand.Send(), and System.Net.Mail.SmtpReplyReaderFactory.StatusCode.

Referenced by System.Net.Mail.SmtpClient.Send().