MailBee.SmtpMail Namespace
MailBee.SmtpMail Namespace

MailBee.SmtpMail namespace contains classes, interfaces and enumerations which can be used by your applications to send mail messages using SMTP protocol. Mail messages can be sent to SMTP relay server, directly to end recipients servers (via DNS MX lookup), or to both. Backup servers can be specified for increased reliability of send mail operations. Another supported operations are submitting messages to MailBee Message Queue or IIS SMTP pickup folder, sending custom commands to the server, authenticating using secure methods, and more.

MailBee supports many popular ESMTP extensions (including PIPELINING), which greatly increases performance of sending messages.

SmtpMail.Smtp (main class of this namespace) is declared as a component, which means you can also just drop it onto your application form instead of creating an instance in the code.

"Quick" methods are also supported, which allows you to send mail in a single line of code.

Powerful mail merge (bulk mailing) capabilities with database support allow sending large volumes of e-mails. Concept of jobs allows the developer to assign a job (which consists of processing a single mail or mail merge), process it, analyze the results, and optionally retry processing failed e-mails again.

The component has built-in support for secure connections (TLS/SSL) and proxy servers (SOCKS4/SOCKS5/HTTP).

Some features (mostly, mail merge over database) are not supported in .NET Core and UWP. Also, UWP apps must use async methods whenever possible.

Classes
  ClassDescription
Public classCode exampleDeliveryNotificationOptions
Provides properties and methods which control how and when ESMTP Delivery Status Notifications (DSN) are sent.
Public classDirectSendServerConfig
Provides properties which specify SMTP server settings to be used by Smtp component for SMTP servers found through MX lookup.
Public classMailBeeDnsRecordsDisabledException
The exception that is thrown when there was an attempt to request DNS records for a non-existent domain or a domain which is dead.
Public classMailBeeMXRecordsDisabledException
The exception that is thrown when there was an attempt to request DNS MX records for a non-existent domain or a domain whose SMTP MX servers are not responsive.
Public classMailBeeSmtp8bitDataNotSupportedException
The exception that is thrown when the message contains 8bit data while the SMTP server is capable of transmitting 7bit data only.
Public classMailBeeSmtpLoginBadCredentialsException
The exception that is thrown when the SMTP server reports the given user account name and/or password is incorrect.
Public classMailBeeSmtpLoginBadMethodException
The exception that is thrown when the SMTP server reports the given ESMTP SASL authentication method is not supported and use of another authentication methods is not allowed by the application.
Public classMailBeeSmtpLoginNegativeResponseException
An abstract parent for all exceptions which indicate the SMTP server replied with a negative response during authentication of the user.
Public classMailBeeSmtpMessageNotAllowedException
An abstract parent for all exceptions that are thrown when the component determines the message could not be submitted to the SMTP server even before starting the actual submission.
Public classMailBeeSmtpMessageSizeOutOfRangeException
The exception that is thrown when the component determines the size of the message data exceeds the maximum size allowed by the SMTP server.
Public classMailBeeSmtpNegativeResponseException
The exception that is thrown when the SMTP server responds with a negative reply (4xx or 5xx, such as 501).
Public classMailBeeSmtpNoAcceptedRecipientsException
The exception that is thrown when the SMTP server refuses all the recipients submitted during the send mail operation.
Public classMailBeeSmtpOptionalCommandNotSupportedException
The exception that is thrown when the SMTP server responds with a negative reply to an optional SMTP command.
Public classMailBeeSmtpRefusedDataException
The exception that is thrown when the SMTP server refuses the message data submitted by the client or even refuses to start receiving the message data from the client.
Public classMailBeeSmtpRefusedRecipientException
The exception that is thrown when the SMTP server refuses to deliver the mail message to the specified recipient.
Public classMailBeeSmtpRefusedSenderException
The exception that is thrown when the SMTP server refuses to deliver the mail message from the specified sender.
Public classMailBeeSmtpSendNegativeResponseException
The exception that is thrown when the SMTP server responds with a negative reply (4xx or 5xx, such as 501) during send mail operation.
Public classSendMailJob
Represents a task to send (or submit to the pickup folder) a single e-mail message or a series of e-mail messages created as a mail merge of a data table and an e-mail template.
Public classSendMailJobCollection
Represents a collection of assigned tasks of sending e-mails.
Public classCode exampleSmtp
Provides properties and methods for sending messages using the SMTP protocol.
Public classSmtpFinishingJobEventArgs
Contains the event data for FinishingJob event.
Public classSmtpMergingMessageEventArgs
Contains the event data for MergingMessage event.
Public classSmtpMessageDataChunkSentEventArgs
Contains the event data for MessageDataChunkSent event.
Public classSmtpMessageDirectSendDoneEventArgs
Contains the event data for MessageDirectSendDone event.
Public classSmtpMessageMXLookupDoneEventArgs
Contains the event data for MessageMXLookupDone event.
Public classSmtpMessageNotSentEventArgs
Contains the event data for MessageNotSent event.
Public classSmtpMessageRecipientSubmittedEventArgs
Contains the event data for MessageRecipientSubmitted event.
Public classSmtpMessageSenderSubmittedEventArgs
Contains the event data for MessageSenderSubmitted event.
Public classSmtpMessageSentEventArgs
Contains the event data for MessageSent event.
Public classSmtpMessageSubmittedToPickupFolderEventArgs
Contains the event data for MessageSubmittedToPickupFolder event.
Public classSmtpMessageSubmittedToServerEventArgs
Contains the event data for MessageSubmittedToServer event.
Public classSmtpSendingMessageEventArgs
Contains the event data for SendingMessage event.
Public classCode exampleSmtpServer
Represents an SMTP relay server to which the mail messages will be sent.
Public classSmtpServerCollection
Represents a sorted collection of SmtpServer objects.
Public classSmtpSubmittingMessageToPickupFolderEventArgs
Contains the event data for SubmittingMessageToPickupFolder event.
Public classSmtpTransientErrorOccurredEventArgs
Contains the event data for TransientErrorOccurred event.
Interfaces
  InterfaceDescription
Public interfaceIMailBeeNegativeSmtpResponseException
When implemented by an exception class, indicates the SMTP server returned negative response. The response data is available in text (i.e. string) form, and SMTP response status code is also available.
Public interfaceIMailBeeSendException
When implemented by an exception class, indicates the exception is related to send mail operation. The list of the recipients, the sender e-mail address, and the mail message itself is available.
Public interfaceIMailBeeSmtpSendException
When implemented by an exception class, indicates the exception is related to send mail to an SMTP server.
Public interfaceIMailBeeSmtpSendNeedsResetException
When implemented by an exception class, indicates RSET command was issued to the SMTP server to reset SMTP session and prepare it for sending another message.
Delegates
  DelegateDescription
Public delegateSmtpFinishingJobEventHandler
Represents the method that will handle FinishingJob event.
Public delegateSmtpMergingMessageEventHandler
Represents the method that will handle MergingMessage event.
Public delegateSmtpMessageDataChunkSentEventHandler
Represents the method that will handle MessageDataChunkSent event.
Public delegateSmtpMessageDirectSendDoneEventHandler
Represents the method that will handle MessageDirectSendDone event.
Public delegateSmtpMessageMXLookupDoneEventHandler
Represents the method that will handle MessageMXLookupDone event.
Public delegateSmtpMessageNotSentEventHandler
Represents the method that will handle MessageNotSent event.
Public delegateSmtpMessageRecipientSubmittedEventHandler
Represents the method that will handle MessageRecipientSubmitted event.
Public delegateSmtpMessageSenderSubmittedEventHandler
Represents the method that will handle MessageSenderSubmitted event.
Public delegateSmtpMessageSentEventHandler
Represents the method that will handle MessageSent event.
Public delegateSmtpMessageSubmittedToPickupFolderEventHandler
Represents the method that will handle MessageSubmittedToPickupFolder event.
Public delegateSmtpMessageSubmittedToServerEventHandler
Represents the method that will handle MessageSubmittedToServer event.
Public delegateSmtpSendingMessageEventHandler
Represents the method that will handle SendingMessage event.
Public delegateSmtpSubmittingMessageToPickupFolderEventHandler
Represents the method that will handle SubmittingMessageToPickupFolder event.
Public delegateSmtpTransientErrorOccurredEventHandler
Represents the method that will handle TransientErrorOccurred event.
Enumerations
  EnumerationDescription
Public enumerationDsnNotifyCondition
Specifies events that trigger ESMTP server to send delivery status notification back to the sender of the message.
Public enumerationDsnReturnPortion
Specifies how much of the original message is returned with the delivery status notification when the message delivery fails.
Public enumerationExtendedSmtpOptions
Provides flags specifying which ESMTP extensions will be enabled during SMTP session.
Public enumerationSendFailureThreshold
Specifies whether TestSend(SendFailureThreshold) method should report error if sending failed to at least one recipient, or to all recipients.
Public enumerationSmtp8bitDataConversion
Defines the available actions to perform when the message contains 8bit data when the SMTP server does not support transmission of 8bit data.
Public enumerationTestSendResult
Provides values returned by TestSend(SendFailureThreshold) method as the result of test send operation.