Smtp Class |
Namespace: MailBee.SmtpMail
The Smtp type exposes the following members.
Name | Description | |
---|---|---|
Smtp |
Creates an instance of Smtp class.
| |
Smtp(String) |
Creates and unlocks an instance of Smtp class.
|
Name | Description | |
---|---|---|
Abort |
Forces MailBee to cancel all pending operations and close all opened connections
as soon as possible.
| |
AddAttachment |
Reads the specified file from disk and adds it as attachment to the message.
| |
AddAttachmentAsync |
async/await version of AddAttachment(String).
| |
AddJob(String, String, EmailAddressCollection) |
Puts an e-mail message onto waiting list for subsequent processing in bulk mode.
| |
AddJob(String, MailMessage, String, EmailAddressCollection) |
Puts the specified e-mail message onto waiting list for subsequent processing in bulk mode.
| |
AddJob(String, String, EmailAddressCollection, DataTable) |
Puts a "mail merge over database" job onto waiting list for subsequent processing in bulk mode.
| |
AddJob(String, String, EmailAddressCollection, IDataReader) |
Puts a "mail merge over database" job onto waiting list for subsequent processing in bulk mode.
| |
AddJob(String, String, Boolean, String, EmailAddressCollection) |
Puts the e-mail message stored in an .EML file onto waiting list for subsequent processing in bulk mode.
| |
AddJob(String, String, EmailAddressCollection, IDataReader, Boolean, Boolean) |
Puts a "mail merge over data reader" job onto waiting list for subsequent processing in bulk mode.
| |
AddJob(String, String, EmailAddressCollection, DataTable, Object, Boolean, Boolean) |
Puts a "mail merge over database" job onto waiting list for subsequent processing in bulk mode.
| |
AuthPopBeforeSmtp |
Authenticates the user on a mail server using POP-before-SMTP authentication.
| |
AuthPopBeforeSmtpAsync |
async/await version of AuthPopBeforeSmtp(String, Int32, String, String).
| |
BeginAuthPopBeforeSmtp | Obsolete.
Begins an asynchronous request for a POP-before-SMTP authentication on a mail server.
| |
BeginConnect | Obsolete.
Begins an asynchronous request for connecting to an SMTP server.
| |
BeginDisconnect | Obsolete.
Begins an asynchronous request for a disconnection from the server.
| |
BeginExecuteCustomCommand | Obsolete.
Begins an asynchronous request for sending the specified user-defined command to the server and getting the response.
| |
BeginHello | Obsolete.
Begins an asynchronous request for sending initial greeting to the SMTP server.
| |
BeginLogin | Obsolete.
Begins an asynchronous request for authenticating the user on the SMTP server.
| |
BeginRelayFromEmlFile | Obsolete.
Begins an asynchronous request for relaying a mail message to recipients.
| |
BeginSend | Obsolete.
Begins an asynchronous request for sending a mail message to recipients.
| |
BeginSendJobs | Obsolete.
Begins an asynchronous request to process the pending jobs and send out the resulting e-mails.
| |
BeginStartTls | Obsolete.
Begins an asynchronous request to start TLS/SSL negotiation with the server.
| |
Connect |
Connects to an SMTP server.
| |
ConnectAsync |
async/await version of Connect.
| |
Disconnect |
Disconnects from the SMTP server and releases any used resources.
| |
DisconnectAsync |
async/await version of Disconnect.
| |
Dispose |
Closes opened network connections (if any) and releases any used system resources.
| |
Dispose(Boolean) |
When overridden in a derived class, must release unmananged and optionally managed
resources used by the component.
| |
EndAuthPopBeforeSmtp |
Ends the pending asynchronous request for POP-before-SMTP authentication on a mail server.
| |
EndConnect |
Ends the pending asynchronous request for connecting to the SMTP server.
| |
EndDisconnect |
Ends a pending asynchronous disconnection request.
| |
EndExecuteCustomCommand |
Ends the pending asynchronous request for sending user-defined command to the server.
| |
EndHello |
Ends the pending asynchronous request for sending a greeting to the SMTP server.
| |
EndLogin |
Ends the pending asynchronous request for authenticating the user on the SMTP server.
| |
EndRelayFromEmlFile |
Ends the pending asynchronous request for relaying the message to the recipients.
| |
EndSend |
Ends the pending asynchronous request for sending the message to the recipients.
| |
EndSendJobs |
Ends the pending asynchronous request for processing the pending jobs and
sending out the resulting e-mails.
| |
EndStartTls |
Ends a pending asynchronous TLS/SSL negotiation request.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
ExecuteCustomCommand |
Sends user-defined command to the server and receives the server response to this command.
| |
ExecuteCustomCommandAsync |
async/await version of ExecuteCustomCommand(String).
| |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetAcceptedRecipients |
Returns the list of the recipients accepted by the SMTP server.
| |
GetCurrentSmtpServerIndex |
Returns SmtpServers collection's index of the server to which
the component is connected or will connect on the next connection attempt.
| |
GetErrorDescription |
Returns a textual description of the last error.
| |
GetExtension |
Returns the name or parameters of the specified ESMTP capability.
| |
GetExtensions |
Returns a reference to the key-value list of the server capabilities.
| |
GetExtensionValue |
Returns the parameters of the specified ESMTP capability, or an empty string
if the capability has no parameters.
| |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetMaxMessageSize |
Returns the maximum length of the message (in bytes) which is allowed by
the SMTP server in order to accept the message from the client.
| |
GetMXHosts |
Retrieves the list of hosts willing to accept mail for the given domain.
| |
GetMXHostsAsync |
async/await version of GetMXHosts(String).
| |
GetPtrData |
Retrieves the list of domain names for the specified IP address.
| |
GetPtrDataAsync |
async/await version of GetPtrData(String).
| |
GetRefusedRecipients |
Returns the list of the recipients rejected by the SMTP server.
| |
GetServerResponse |
Returns the last response from the server.
| |
GetServerResponseCode |
Returns an integer value containing the status code of the last SMTP operation.
| |
GetSocket |
Returns the underlying Socket MailBee uses for the
current SMTP connection.
| |
GetSocketError |
Returns a Win32 error code of the last socket-related error.
| |
GetStream |
Returns the underlying Stream MailBee uses for the
current network connection.
| |
GetSupportedAuthMethods |
Returns a set of flags indicating which authentication methods are supported by the server.
| |
GetTxtData |
Retrieves the list of TXT strings of DNS data of the specified domain.
| |
GetTxtDataAsync |
async/await version of GetTxtData(String).
| |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
Hello |
Sends initial greeting to the SMTP server.
| |
HelloAsync |
async/await version of Hello.
| |
Login |
Authenticates the user on the SMTP server if ESMTP authentication is enabled.
| |
LoginAsync |
async/await version of Login.
| |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Noop |
Sends a NOOP command to the server.
| |
NoopAsync |
async/await version of Noop.
| |
OnConnected |
Used by MailBee to raise Connected event.
| |
OnDataReceived |
Used by MailBee to raise DataReceived event.
| |
OnDataSent |
Used by MailBee to raise DataSent event.
| |
OnDisconnected |
Used by MailBee to raise Disconnected event.
| |
OnErrorOccurred |
Used by MailBee to raise ErrorOccurred event.
| |
OnFinishingJob |
Used by MailBee to raise FinishingJob event.
| |
OnHostResolved |
Used by MailBee to raise HostResolved event.
| |
OnLoggedIn |
Used by MailBee to raise LoggedIn event.
| |
OnLogNewEntry |
Used by MailBee to raise LogNewEntry event.
| |
OnLowLevelDataReceived |
Used by MailBee to raise LowLevelDataReceived event.
| |
OnLowLevelDataSent |
Used by MailBee to raise LowLevelDataSent event.
| |
OnMergingMessage |
Used by MailBee to raise MergingMessage event.
| |
OnMessageDataChunkSent |
Used by MailBee to raise MessageDataChunkSent event.
| |
OnMessageDirectSendDone |
Used by MailBee to raise MessageDirectSendDone event.
| |
OnMessageMXLookupDone |
Used by MailBee to raise MessageMXLookupDone event.
| |
OnMessageNotSent |
Used by MailBee to raise MessageNotSent event.
| |
OnMessageRecipientSubmitted |
Used by MailBee to raise MessageRecipientSubmitted event.
| |
OnMessageSenderSubmitted |
Used by MailBee to raise MessageSenderSubmitted event.
| |
OnMessageSent |
Used by MailBee to raise MessageSent event.
| |
OnMessageSubmittedToPickupFolder |
Used by MailBee to raise MessageSubmittedToPickupFolder event.
| |
OnMessageSubmittedToServer |
Used by MailBee to raise MessageSubmittedToServer event.
| |
OnSendingMessage |
Used by MailBee to raise SendingMessage event.
| |
OnSocketConnected |
Used by MailBee to raise SocketConnected event.
| |
OnSocketCreating |
Used by MailBee to raise SocketCreating event.
| |
OnSubmittingMessageToPickupFolder |
Used by MailBee to raise SubmittingMessageToPickupFolder event.
| |
OnTlsStarted |
Used by MailBee to raise TlsStarted event.
| |
OnTransientErrorOccurred |
Used by MailBee to raise TransientErrorOccurred event.
| |
QuickSend(MailMessage) |
Sends a mail message, in a single line of code.
| |
QuickSend(String, String, String, String) |
Sends a mail message, in a single line of code.
| |
QuickSend(String, String, String, String, String, String, String) |
Sends a mail message, in a single line of code.
| |
RelayFromEmlFile(String, String, EmailAddressCollection) |
Relays (sends without any modifications) the mail message previously saved as an .EML file,
to the specified recipients.
| |
RelayFromEmlFile(String, String, String) |
Relays (sends without any modifications) the mail message previously saved as an .EML file,
to the specified recipients.
| |
RelayFromEmlFileAsync(String, String, EmailAddressCollection) |
async/await version of RelayFromEmlFile(String, String, EmailAddressCollection).
| |
RelayFromEmlFileAsync(String, String, String) |
async/await version of RelayFromEmlFile(String, String, String).
| |
ResetMessage |
Resets all properties of Message object to defaults. Delivery Status
Notification settings (DeliveryNotification object) are also reset.
| |
ResetState |
Resets the internal state of the component.
| |
RetryFailedJobs |
Puts all failed send-mail jobs back into the queue.
| |
Send |
Sends the mail message to the recipients specified in the message.
| |
Send(String, EmailAddressCollection) |
Sends the mail message to the specified recipients.
| |
Send(String, String) |
Sends the mail message to the specified recipients e-mail addresses.
| |
SendAsync |
async/await version of Send.
| |
SendAsync(String, EmailAddressCollection) |
async/await version of Send(String, EmailAddressCollection).
| |
SendAsync(String, String) |
async/await version of Send(String, String).
| |
SendJobs |
Sends out all e-mails in the pending jobs queue (including e-mails generated via mail merge).
| |
SendJobsAsync |
async/await version of SendJobs.
| |
SendMailMerge(String, EmailAddressCollection, DataTable) |
Creates a series of e-mails based on an e-mail message template and a data table
and sends these e-mails out.
| |
SendMailMerge(String, EmailAddressCollection, IDataReader) |
Creates a series of e-mails based on an e-mail message template and a data reader
and sends these e-mails out.
| |
SendMailMergeAsync(String, EmailAddressCollection, DataTable) |
async/await version of SendMailMerge(String, EmailAddressCollection, DataTable).
| |
SendMailMergeAsync(String, EmailAddressCollection, IDataReader) |
async/await version of SendMailMerge(String, EmailAddressCollection, IDataReader).
| |
StartTls |
Requests the mail server to start TLS/SSL negotiation and protect the existing connection with a security layer.
| |
StartTlsAsync |
async/await version of StartTls.
| |
StopJobs |
Notifies MailBee to stop processing jobs, completing sending out of all messages currently being processed.
| |
SubmitJobsToPickupFolder |
Saves all e-mails in the pending jobs queue (including e-mails generated via mail merge)
as files in the pickup folder of MailBee.NET Queue or IIS SMTP service.
| |
SubmitJobsToPickupFolderAsync |
async/await version of SubmitJobsToPickupFolder(String, Boolean).
| |
SubmitToPickupFolder(String, Boolean) |
Saves the mail message as a file in the pickup folder of MailBee.NET Queue or IIS SMTP service.
| |
SubmitToPickupFolder(String, String, String, EmailAddressCollection, Boolean) |
Saves the mail message as a file in the pickup folder of MailBee.NET Queue or IIS SMTP service.
| |
SubmitToPickupFolder(String, String, String, String, Boolean) |
Saves the mail message as a file in the pickup folder of MailBee.NET Queue or IIS SMTP service.
| |
SubmitToPickupFolderAsync(String, Boolean) |
async/await version of SubmitToPickupFolder(String, Boolean).
| |
SubmitToPickupFolderAsync(String, String, String, EmailAddressCollection, Boolean) |
async/await version of SubmitToPickupFolder(String, String, String, EmailAddressCollection, Boolean).
| |
SubmitToPickupFolderAsync(String, String, String, String, Boolean) |
async/await version of SubmitToPickupFolder(String, String, String, String, Boolean).
| |
TestSend |
Tests sending a mail message to the recipients without actual submitting of the message
data.
| |
TestSendAsync |
async/await version of TestSend(SendFailureThreshold).
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
ValidateEmailAddressSyntax |
Verifies if the specified string is a correctly formatted e-mail address.
| |
Wait | Obsolete.
Waits until the currently running (if any) asynchronous method is finished.
| |
Wait(Int32) | Obsolete.
Waits the completion of the currently running (if any) asynchronous method
for the specified amount of time.
|
Name | Description | |
---|---|---|
Bcc |
Gets or sets EmailAddressCollection object specifying BCC: recipients of the message.
| |
BodyHtmlText |
Gets or sets HTML version of the message body.
| |
BodyPlainText |
Gets or sets plain-text version of the message body.
| |
Cc |
Gets or sets EmailAddressCollection object specifying CC: recipients of the message.
| |
Charset |
Gets or sets charset of the message.
| |
Conversion8BitTo7bit |
Gets or sets if (and how) the component should perform 8bit-to-7bit conversion of the message
data if the given SMTP server does not support transmission of 8bit data but the message
does contain such data.
| |
DeliveryNotification |
Provides access to properties which control when and how ESMTP Delivery Status Notification
messages will be sent to the message sender.
| |
DirectSendDefaults |
Provides access to the default SMTP server settings to be used when connecting to
SMTP servers discovered by MailBee via DNS MX lookup.
| |
DnsServers |
Gets the DnsServerCollection object containing the list of DNS servers
to be used for DNS MX lookup.
| |
From |
Gets or sets EmailAddress object specifying the message sender.
| |
IsAborted |
Indicates whether Abort method has been called for the component.
| |
IsBusy |
Indicates whether the component is performing a lengthy operation.
| |
IsConnected |
Indicates whether the component is connected to the server.
| |
IsLoggedIn |
Indicates whether the component has already successfully authenticated on the server
and logged in the user account.
| |
IsSmtpContext |
Indicates whether the component is currently operating in a single thread mode,
and the current connection (if any) is an SMTP connection.
| |
IsSslConnection |
Indicates whether the current connection (if any) is secured with TLS/SSL layer.
| |
JobsFailed |
Gets the list of e-mail tasks failed during processing.
| |
JobsPending |
Gets the list of send-mail (sending a single message or mail-merge) tasks ready for processing.
| |
JobsRunning |
Gets the list of e-mail tasks being processed right now.
| |
JobsSuccessful |
Gets the list of successfully processed e-mail tasks.
| |
JobsSyncRoot |
Gets the object to be used for synchronized access to the jobs collections.
| |
LastResult |
Gets a numeric code of the last error.
| |
LicenseKey | Obsolete.
Assigns the license key.
| |
Log |
Gets the object used for logging MailBee activities into a file or memory buffer.
| |
MaxThreadCount |
Gets or sets the maximum number of threads MailBee may create during send mail
operations.
| |
Message |
Gets or sets the mail message which will be sent by the component on Send
method call.
| |
RaiseEvents |
Gets or sets whether the component will raise any events.
| |
RaiseEventsViaMessageLoop |
Gets or sets whether the events will be raised on the message loop of the application
or not.
| |
ReplyTo |
Gets or sets EmailAddressCollection object specifying e-mail addresses
to which the replies to this message should be sent.
| |
RequestEncoding |
Gets or sets the encoding used to convert a string into a bytes stream
which is then sent to the server.
| |
ResponseEncoding |
Gets or sets the encoding used to convert a byte data received from the server into a string.
| |
Site |
Gets or sets the object to be used as a site for the component.
| |
SmtpServers |
Gets the SmtpServerCollection object containing the list of SMTP relay servers
to be used for sending mail.
| |
StopJobsOnError |
Gets or sets if processing of the jobs must be stopped if an error occurs.
| |
Subject |
Gets or sets the subject of the message.
| |
SynchronizingObject |
Gets or sets the object used to marshal the calls of the event handlers.
| |
ThrowExceptions |
Gets or sets whether the component will throw exceptions on errors.
| |
To |
Gets or sets EmailAddressCollection object specifying To: recipients of the message.
| |
TrialDaysLeft |
Gets the number of days left to the date of the trial license key expiration.
| |
Version |
Gets the version of the MailBee assembly.
|
Name | Description | |
---|---|---|
Connected |
Occurs when the connection with the server is successfully established.
| |
DataReceived |
Occurs when data is received from the network.
| |
DataSent |
Occurs when data is sent to the network.
| |
Disconnected |
Occurs when the connection with the server gets closed.
| |
Disposed |
Occurs after the component was disposed.
| |
ErrorOccurred |
Occurs when the MailBeeException is thrown.
| |
FinishingJob |
Occurs when the component is about to finish a job of sending an individual e-mail message or a mail merge series.
| |
HostResolved |
Occurs when the SMTP server name is successully resolved into IP address(es).
| |
LoggedIn |
Occurs when the component successfully authenticates the user on the SMTP server and logs
in the user account.
| |
LogNewEntry | ||
LowLevelDataReceived |
Occurs when data is received from the connected socket.
| |
LowLevelDataSent |
Occurs when data is sent to the connected socket.
| |
MergingMessage |
Occurs when the component is about to merge the e-mail template with a single data table row.
| |
MessageDataChunkSent |
Occurs on progress of sending message source data to the SMTP server.
| |
MessageDirectSendDone |
Occurs in direct send mode when the component finished submitting the mail message
to all SMTP MX servers of recipients domains.
| |
MessageMXLookupDone |
Occurs in direct send mode after the component finished DNS MX lookup
of SMTP MX servers of recipients domains.
| |
MessageNotSent |
Occurs when the message was not sent due to an error.
| |
MessageRecipientSubmitted |
Occurs each time the next recipient in the mail message recipients list is
accepted or refused by the SMTP server.
| |
MessageSenderSubmitted |
Occurs after the sender of the mail message was successfully submitted to the SMTP server.
| |
MessageSent |
Occurs after the message was successfully sent.
| |
MessageSubmittedToPickupFolder |
Occurs after the current message was saved to MailBee.NET Queue or IIS SMTP pickup folder.
| |
MessageSubmittedToServer |
Occurs each time the message is successfully submitted to the SMTP server.
| |
SendingMessage |
Occurs when the message is about to be sent.
| |
SocketConnected |
Occurs when the SMTP server accepts the connection attempt and opens the transmission
channel between the remote host (SMTP server) and the client (MailBee).
| |
SocketCreating |
Occurs when MailBee needs a new socket object for establishing a connection with the SMTP server.
| |
SubmittingMessageToPickupFolder |
Occurs when the message is about to be saved into MailBee.NET Queue or IIS SMTP pickup folder.
| |
TlsStarted |
Occurs when the connection with the server becomes secure.
| |
TransientErrorOccurred |
Occurs on a transient SMTP error which can be ignored because at least one fail-over SMTP server hasn't been tried yet.
|
Note |
---|
Database-related functionality (such as mail merge over database) is not available in .NET Core and UWP. |
// To use the code below, import MailBee namespaces at the top of your code. using MailBee; using MailBee.SmtpMail; // The actual code (put it into a method of your class). Smtp mailer = new Smtp(); // Set the message fields. mailer.From.AsString = "John Doe <jdoe@domain1.com>"; mailer.To.AsString = "Bill Smith <b.smith@domain2.com>"; mailer.Subject = "Weekly newsletter"; mailer.BodyPlainText = "This is the newsletter contents"; // Specify the server to use. If your server does not require authentication, // just remove last 2 parameters. mailer.SmtpServers.Add("smtp.domain1.com", "jdoe", "secret"); // Disable ESMTP CHUNKING even if the server claims CHUNKING is supported // (often helps with MS Exchange servers). mailer.SmtpServers[0].SmtpOptions = ExtendedSmtpOptions.NoChunking; // Send the message. mailer.Send(); Console.WriteLine("The message was successfully submitted to the server.");