mscorlib(4.0.0.0) API with additions
System.Net.Mail Namespace Reference

Classes

class  AlternateView
 Represents the format to view an email message. More...
 
class  AlternateViewCollection
 Represents a collection of T:System.Net.Mail.AlternateView objects. More...
 
class  Attachment
 Represents an attachment to an e-mail. More...
 
class  AttachmentBase
 Base class that represents an email attachment. Classes T:System.Net.Mail.Attachment, T:System.Net.Mail.AlternateView, and T:System.Net.Mail.LinkedResource derive from this class. More...
 
class  AttachmentCollection
 Stores attachments to be sent as part of an e-mail message. More...
 
class  LinkedResource
 Represents an embedded external resource in an email attachment, such as an image in an HTML attachment. More...
 
class  LinkedResourceCollection
 Stores linked resources to be sent as part of an e-mail message. More...
 
class  MailAddress
 Represents the address of an electronic mail sender or recipient. More...
 
class  MailAddressCollection
 Store e-mail addresses that are associated with an e-mail message. More...
 
class  MailMessage
 Represents an e-mail message that can be sent using the T:System.Net.Mail.SmtpClient class. More...
 
class  SmtpClient
 Allows applications to send e-mail by using the Simple Mail Transfer Protocol (SMTP). More...
 
class  SmtpException
 Represents the exception that is thrown when the T:System.Net.Mail.SmtpClient is not able to complete a Overload:System.Net.Mail.SmtpClient.Send or Overload:System.Net.Mail.SmtpClient.SendAsync operation. More...
 
class  SmtpFailedRecipientException
 Represents the exception that is thrown when the T:System.Net.Mail.SmtpClient is not able to complete a Overload:System.Net.Mail.SmtpClient.Send or Overload:System.Net.Mail.SmtpClient.SendAsync operation to a particular recipient. More...
 
class  SmtpFailedRecipientsException
 The exception that is thrown when e-mail is sent using an T:System.Net.Mail.SmtpClient and cannot be delivered to all recipients. More...
 
class  SmtpPermission
 Controls access to Simple Mail Transport Protocol (SMTP) servers. More...
 
class  SmtpPermissionAttribute
 Controls access to Simple Mail Transport Protocol (SMTP) servers. More...
 

Enumerations

enum  DeliveryNotificationOptions {
  DeliveryNotificationOptions.None = 0x0, DeliveryNotificationOptions.OnSuccess = 0x1, DeliveryNotificationOptions.OnFailure = 0x2, DeliveryNotificationOptions.Delay = 0x4,
  DeliveryNotificationOptions.Never = 0x8000000
}
 Describes the delivery notification options for e-mail. More...
 
enum  MailHeaderID {
  Bcc = 0, Cc = 1, Comments = 2, ContentDescription = 3,
  ContentDisposition = 4, ContentID = 5, ContentLocation = 6, ContentTransferEncoding = 7,
  ContentType = 8, Date = 9, From = 10, Importance = 11,
  InReplyTo = 12, Keywords = 13, Max = 14, MessageID = 0xF,
  MimeVersion = 0x10, Priority = 17, References = 18, ReplyTo = 19,
  ResentBcc = 20, ResentCc = 21, ResentDate = 22, ResentFrom = 23,
  ResentMessageID = 24, ResentSender = 25, ResentTo = 26, Sender = 27,
  Subject = 28, To = 29, XPriority = 30, XReceiver = 0x1F,
  XSender = 0x20, ZMaxEnumValue = 0x20, Unknown = -1
}
 
enum  MailPriority { MailPriority.Normal, MailPriority.Low, MailPriority.High }
 Specifies the priority of a T:System.Net.Mail.MailMessage. More...
 
enum  MBDataType : byte {
  All, Dword, String, Binary,
  StringExpand, MultiString
}
 
enum  MBErrors {
  DataNotFound = -2146646015, InvalidVersion = -2146646014, DuplicateNameWarning = 837636, InvalidDataWarning = 837637,
  AlreadyExists = -2147024713, InvalidParameter = -2147024809, PathNotFound = -2147024893, PathBusy = -2147024748,
  InsufficientBuffer = -2147024774, NoMoreItems = -2147024637, AccessDenied = -2147024891
}
 
enum  MBKeyAccess : uint { Read = 0x1, Write = 0x2 }
 
enum  MBUserType : byte {
  Other = 0, Asp = 101, File = 2, Server = 1,
  Wam = 100
}
 
enum  PropertyName { Invalid = 0, ServerState = 1016, PickupDirectory = 36880 }
 
enum  RecipientLocationType {
  Local, Unknown, NotLocal, WillForward,
  Ambiguous
}
 
enum  ServerState {
  Starting = 1, Started, Stopping, Stopped,
  Pausing, Paused, Continuing
}
 
enum  SmtpAccess { SmtpAccess.None, SmtpAccess.Connect, SmtpAccess.ConnectToUnrestrictedPort }
 Specifies the level of access allowed to a Simple Mail Transport Protocol (SMTP) server. More...
 
enum  SmtpDeliveryFormat { SmtpDeliveryFormat.SevenBit, SmtpDeliveryFormat.International }
 The delivery format to use for sending outgoing e-mail using the Simple Mail Transport Protocol (SMTP). More...
 
enum  SmtpDeliveryMethod { SmtpDeliveryMethod.Network, SmtpDeliveryMethod.SpecifiedPickupDirectory, SmtpDeliveryMethod.PickupDirectoryFromIis }
 Specifies how email messages are delivered. More...
 
enum  SmtpStatusCode {
  SmtpStatusCode.SystemStatus = 211, SmtpStatusCode.HelpMessage = 214, SmtpStatusCode.ServiceReady = 220, SmtpStatusCode.ServiceClosingTransmissionChannel = 221,
  SmtpStatusCode.Ok = 250, SmtpStatusCode.UserNotLocalWillForward = 251, SmtpStatusCode.CannotVerifyUserWillAttemptDelivery = 252, SmtpStatusCode.StartMailInput = 354,
  SmtpStatusCode.ServiceNotAvailable = 421, SmtpStatusCode.MailboxBusy = 450, SmtpStatusCode.LocalErrorInProcessing = 451, SmtpStatusCode.InsufficientStorage = 452,
  SmtpStatusCode.ClientNotPermitted = 454, SmtpStatusCode.CommandUnrecognized = 500, SmtpStatusCode.SyntaxError = 501, SmtpStatusCode.CommandNotImplemented = 502,
  SmtpStatusCode.BadCommandSequence = 503, SmtpStatusCode.MustIssueStartTlsFirst = 530, SmtpStatusCode.CommandParameterNotImplemented = 504, SmtpStatusCode.MailboxUnavailable = 550,
  SmtpStatusCode.UserNotLocalTryAlternatePath = 551, SmtpStatusCode.ExceededStorageAllocation = 552, SmtpStatusCode.MailboxNameNotAllowed = 553, SmtpStatusCode.TransactionFailed = 554,
  SmtpStatusCode.GeneralFailure = -1
}
 Specifies the outcome of sending e-mail by using the T:System.Net.Mail.SmtpClient class. More...
 
enum  SupportedAuth {
  None = 0, Login = 1, NTLM = 2, GSSAPI = 4,
  WDigest = 8
}
 

Functions

delegate void SendCompletedEventHandler (object sender, AsyncCompletedEventArgs e)
 Represents the method that will handle the E:System.Net.Mail.SmtpClient.SendCompleted event. More...
 

Enumeration Type Documentation

◆ DeliveryNotificationOptions

Describes the delivery notification options for e-mail.

Enumerator
None 

No notification information will be sent. The mail server will utilize its configured behavior to determine whether it should generate a delivery notification.

OnSuccess 

Notify if the delivery is successful.

OnFailure 

Notify if the delivery is unsuccessful.

Delay 

Notify if the delivery is delayed.

Never 

A notification should not be generated under any circumstances.

Definition at line 5 of file DeliveryNotificationOptions.cs.

◆ MailPriority

Specifies the priority of a T:System.Net.Mail.MailMessage.

Enumerator
Normal 

The email has normal priority.

Low 

The email has low priority.

High 

The email has high priority.

Definition at line 4 of file MailPriority.cs.

◆ SmtpAccess

Specifies the level of access allowed to a Simple Mail Transport Protocol (SMTP) server.

Enumerator
None 

No access to an SMTP host.

Connect 

Connection to an SMTP host on the default port (port 25).

ConnectToUnrestrictedPort 

Connection to an SMTP host on any port.

Definition at line 4 of file SmtpAccess.cs.

◆ SmtpDeliveryFormat

The delivery format to use for sending outgoing e-mail using the Simple Mail Transport Protocol (SMTP).

Enumerator
SevenBit 

A delivery format using 7-bit ASCII. The traditional delivery format used in the Simple Mail Transport Protocol (SMTP) for mail messages.

International 

A delivery format where non-ASCII characters in the envelope and header fields used in the Simple Mail Transport Protocol (SMTP) for mail messages are encoded with UTF-8 characters. The extensions to support international e-mail are defined in IETF RFC 6530, 6531, and 6532.

Definition at line 4 of file SmtpDeliveryFormat.cs.

◆ SmtpDeliveryMethod

Specifies how email messages are delivered.

Enumerator
Network 

Email is sent through the network to an SMTP server.

SpecifiedPickupDirectory 

Email is copied to the directory specified by the P:System.Net.Mail.SmtpClient.PickupDirectoryLocation property for delivery by an external application.

PickupDirectoryFromIis 

Email is copied to the pickup directory used by a local Internet Information Services (IIS) for delivery.

Definition at line 4 of file SmtpDeliveryMethod.cs.

◆ SmtpStatusCode

Specifies the outcome of sending e-mail by using the T:System.Net.Mail.SmtpClient class.

Enumerator
SystemStatus 

A system status or system Help reply.

HelpMessage 

A Help message was returned by the service.

ServiceReady 

The SMTP service is ready.

ServiceClosingTransmissionChannel 

The SMTP service is closing the transmission channel.

Ok 

The email was successfully sent to the SMTP service.

UserNotLocalWillForward 

The user mailbox is not located on the receiving server; the server forwards the e-mail.

CannotVerifyUserWillAttemptDelivery 

The specified user is not local, but the receiving SMTP service accepted the message and attempted to deliver it. This status code is defined in RFC 1123, which is available at http://www.ietf.org.

StartMailInput 

The SMTP service is ready to receive the e-mail content.

ServiceNotAvailable 

The SMTP service is not available; the server is closing the transmission channel.

MailboxBusy 

The destination mailbox is in use.

LocalErrorInProcessing 

The SMTP service cannot complete the request. This error can occur if the client's IP address cannot be resolved (that is, a reverse lookup failed). You can also receive this error if the client domain has been identified as an open relay or source for unsolicited e-mail (spam). For details, see RFC 2505, which is available at http://www.ietf.org.

InsufficientStorage 

The SMTP service does not have sufficient storage to complete the request.

ClientNotPermitted 

The client was not authenticated or is not allowed to send mail using the specified SMTP host.

CommandUnrecognized 

The SMTP service does not recognize the specified command.

SyntaxError 

The syntax used to specify a command or parameter is incorrect.

CommandNotImplemented 

The SMTP service does not implement the specified command.

BadCommandSequence 

The commands were sent in the incorrect sequence.

MustIssueStartTlsFirst 

The SMTP server is configured to accept only TLS connections, and the SMTP client is attempting to connect by using a non-TLS connection. The solution is for the user to set EnableSsl=true on the SMTP Client.

CommandParameterNotImplemented 

The SMTP service does not implement the specified command parameter.

MailboxUnavailable 

The destination mailbox was not found or could not be accessed.

UserNotLocalTryAlternatePath 

The user mailbox is not located on the receiving server. You should resend using the supplied address information.

ExceededStorageAllocation 

The message is too large to be stored in the destination mailbox.

MailboxNameNotAllowed 

The syntax used to specify the destination mailbox is incorrect.

TransactionFailed 

The transaction failed.

GeneralFailure 

The transaction could not occur. You receive this error when the specified SMTP host cannot be found.

Definition at line 4 of file SmtpStatusCode.cs.

Function Documentation

◆ SendCompletedEventHandler()

delegate void System.Net.Mail.SendCompletedEventHandler ( object  sender,
AsyncCompletedEventArgs  e 
)

Represents the method that will handle the E:System.Net.Mail.SmtpClient.SendCompleted event.

Parameters
senderThe source of the event.
eAn T:System.ComponentModel.AsyncCompletedEventArgs containing event data.