132 if (encoding !=
null &&
value !=
null)
221 [param: DisallowNull]
247 if (from.Length == 0)
280 emptySendContext.
_result.InvokeCallback(result2);
287 writer.WriteHeaders(Headers, allowUnicode);
290 return Content.BeginSend(
writer, callback, allowUnicode,
state);
299 return lazyAsyncResult;
317 if (lazyAsyncResult.EndCalled)
321 lazyAsyncResult.InternalWaitForCompletion();
322 lazyAsyncResult.EndCalled =
true;
337 writer.WriteHeaders(Headers, allowUnicode);
340 Content.Send(
writer, allowUnicode);
344 writer.GetContentStream().Close();
388 Headers.InternalAdd(@
string,
Sender.
Encode(@
string.Length, allowUnicode));
392 Headers.Remove(@
string);
395 Headers.InternalAdd(@
string,
From.
Encode(@
string.Length, allowUnicode));
399 Headers.InternalAdd(@
string,
To.
Encode(@
string.Length, allowUnicode));
403 Headers.Remove(@
string);
408 Headers.InternalAdd(@
string,
CC.
Encode(@
string.Length, allowUnicode));
412 Headers.Remove(@
string);
417 Headers.InternalAdd(@
string,
ReplyTo.
Encode(@
string.Length, allowUnicode));
425 Headers.Remove(@
string);
448 if (!
string.IsNullOrEmpty(
_subject))
452 Headers.InternalAdd(@
string,
_subject);
461 Headers.Remove(@
string);
472 for (
int i = 0; i < headers.
Count; i++)
480 string empty =
string.Empty;
481 for (
int j = 0; j <
values.Length; j++)
498 for (
int i = 0; i < Headers.Count; i++)
virtual ? string GetKey(int index)
void InvokeCallback(object result)
string Encode(int charsConsumed, bool allowUnicode)
void Add(string addresses)
string Encode(int charsConsumed, bool allowUnicode)
System.Net.LazyAsyncResult _result
EmptySendContext(BaseWriter writer, System.Net.LazyAsyncResult result)
void PrepareHeaders(bool sendEnvelope, bool allowUnicode)
void PrepareEnvelopeHeaders(bool sendEnvelope, bool allowUnicode)
bool IsHeaderSet(string headerName)
HeaderCollection _headers
MailAddressCollection Bcc
void EndSend(IAsyncResult asyncResult)
void EncodeHeaders(HeaderCollection headers, bool allowUnicode)
MailAddressCollection _replyToList
IAsyncResult BeginSend(BaseWriter writer, bool sendEnvelope, bool allowUnicode, AsyncCallback callback, object state)
MailAddressCollection ReplyToList
HeaderCollection _envelopeHeaders
MailAddressCollection _to
Message(string from, string to)
MailAddressCollection _cc
void Send(BaseWriter writer, bool sendEnvelope, bool allowUnicode)
MailAddressCollection _bcc
HeaderCollection EnvelopeHeaders
void EmptySendCallback(IAsyncResult result)
Message(MailAddress from, MailAddress to)
Encoding _headersEncoding
Encoding _subjectEncoding
Stream EndGetContentStream(IAsyncResult result)
static string GetDateTimeString(DateTime value, StringBuilder builder)
static bool HasCROrLF(string data)
static bool IsAscii(string value, bool permitCROrLF)
static string EncodeHeaderValue(string value, Encoding encoding, bool base64Encoding)
static bool ShouldUseBase64Encoding(Encoding encoding)
static Encoding DecodeEncoding(string value)
static string DecodeHeaderValue(string value)
static readonly System.Net.NetEventSource Log
static void Associate(object first, object second, [CallerMemberName] string memberName=null)
static string net_io_invalidendcall
static string Format(string resourceFormat, object p1)
static string net_io_invalidasyncresult
static string MailSubjectInvalidFormat
static string net_emptystringcall
static Encoding GetEncoding(int codepage)
bool CompletedSynchronously