Rebex
Products Downloads Buy Support Contact
Show / Hide Table of Contents

Smtp.Send Method

Namespace: Rebex.Net
Assembly: Rebex.Smtp.dll (version 7.0.9147)

Send(MimeMessage, String, String)

Sends a mail message (MimeMessage).

Declaration
public void Send(MimeMessage mail, string sender, string recipients)
Parameters
Type Name Description
MimeMessage mail

The message.

String sender

Message sender address (can be null or empty).

String recipients

The list of recipients (can be null).

Remarks

If the sender address argument is null (Nothing in Visual Basic), it is taken from the from the "Sender" header field or from the first address in the "From" field if the "Sender" is missing.
If the sender address argument is empty string, it means null sender - same behavior as if "<>" would be specified.
If the recipients argument is null (Nothing in Visual Basic), it overrides the list of recipients contained in the message. If the recipients argument is null, the list of recipients is extracted from "To", "Cc" and "Bcc" header fields.
The "Bcc" field is removed from message headers prior to sending. Set the AllowNullSender property to allow sending a mime message without a sender specified.

Send(MailMessage, String, String)

Sends a mail message (MailMessage).

Declaration
public void Send(MailMessage mail, string sender, string recipients)
Parameters
Type Name Description
MailMessage mail

The message.

String sender

Message sender address (can be null or empty string).

String recipients

The list of recipients (can be null).

Remarks

If the sender address argument is null (Nothing in Visual Basic), it is taken from the from the "Sender" header field or from the first address in the "From" field if the "Sender" is missing.
If the sender address argument is empty string, it means null sender - same behavior as if "<>" would be specified.
If the recipients argument is null (Nothing in Visual Basic), it overrides the list of recipients contained in the message. If the recipients argument is null, the list of recipients is extracted from "To", "Cc" and "Bcc" header fields.
The "Bcc" field is removed from message headers prior to sending. Set the AllowNullSender property to allow sending a mail message without a sender specified.

Send(MimeMessage)

Sends a mail message (MimeMessage).

Declaration
public void Send(MimeMessage mail)
Parameters
Type Name Description
MimeMessage mail

The message.

Remarks

Both sender and the list of recipients are extracted from the message. The sender address is taken from the "Sender" header field or from the first address in the "From" field if the "Sender" is missing. The list of recipients comes from "To", "Cc" and "Bcc" header fields. Also, the "Bcc" field is removed from message headers prior to sending. Set the AllowNullSender property to allow sending a mime message without a sender specified.

Send(MailMessage)

Sends a mail message (MailMessage).

Declaration
public void Send(MailMessage mail)
Parameters
Type Name Description
MailMessage mail

The message.

Remarks

Both sender and the list of recipients are extracted from the message. The sender address is taken from the "Sender" header field or from the first address in the "From" field if the "Sender" is missing. The list of recipients comes from "To", "Cc" and "Bcc" header fields. Also, the "Bcc" field is removed from message headers prior to sending. Set the AllowNullSender property to allow sending a mail message without a sender specified.

Send(String, String, String, String)

Sends a mail message constructed from the specified parameters.

Declaration
public void Send(string from, string to, string subject, string body)
Parameters
Type Name Description
String from

Message sender.

String to

Comma-separated list of message recipients.

String subject

The subject of the message.

String body

The text body of the message.

Remarks

Set the AllowNullSender property to allow sending a mail without a sender specified.

Send(Stream, String, String)

Reads and sends a mail message from the specified stream in MIME format.

Declaration
public void Send(Stream input, string sender, string recipients)
Parameters
Type Name Description
Stream input

The input stream.

String sender

Message sender address (can be null or empty string).

String recipients

The list of recipients (can be null).

Remarks

The stream must contain data in MIME format, other formats are not supported. MIME files often have the '.eml' extension and are produced by Outlook Express. In contrast, Outlook produces '.msg' files that are not MIME files and therefore cannot be sent using this method.

If the sender address argument is null (Nothing in Visual Basic), it is taken from the from the "Sender" header field or from the first address in the "From" field if the "Sender" is missing.
If the sender address argument is empty string, it means null sender - same behavior as if "<>" would be specified.
If the recipients argument is null (Nothing in Visual Basic), it overrides the list of recipients contained in the message. If the recipients argument is null, the list of recipients is extracted from "To", "Cc" and "Bcc" header fields.
The "Bcc" field is removed from message headers prior to sending.

Set the AllowNullSender property to allow sending a mail without a sender specified.

Send(Stream)

Reads and sends a mail message from the specified stream in MIME format.

Declaration
public void Send(Stream input)
Parameters
Type Name Description
Stream input

The input stream.

Remarks

The stream must contain data in MIME format, other formats are not supported. MIME files often have the '.eml' extension and are produced by Outlook Express. In contrast, Outlook produces '.msg' files that are not MIME files and therefore cannot be sent using this method.

Both sender and the list of recipients are extracted from the message. The sender address is taken from the "Sender" header field, or from the first address in the "From" field if the "Sender" is missing. The list of recipients comes from "To", "Cc" and "Bcc" header fields. Also, the "Bcc" field is removed from message headers prior to sending.

Set the AllowNullSender property to allow sending a mail without a sender specified.

Send(String)

Reads and sends a mail message from the specified local file in MIME format.

Declaration
public void Send(string fileName)
Parameters
Type Name Description
String fileName

The path to the mail message file.

Remarks

The file must be in MIME format, other formats are not supported. MIME files often have the '.eml' extension and are produced by Outlook Express. In contrast, Outlook produces '.msg' files that are not MIME files and therefore cannot be sent using this method.

Both sender and the list of recipients are extracted from the message. The sender address is taken from the "Sender" header field, or from the first address in the "From" field if the "Sender" is missing. The list of recipients comes from "To", "Cc" and "Bcc" header fields. Also, the "Bcc" field is removed from message headers prior to sending.

Set the AllowNullSender property to allow sending a mail without a sender specified.

Send(String, String, String)

Reads and sends a mail message from the specified local file in MIME format.

Declaration
public void Send(string fileName, string sender, string recipients)
Parameters
Type Name Description
String fileName

The path to the mail message file.

String sender

Message sender address (can be null or empty string).

String recipients

The list of recipients (can be null).

Remarks

The stream must contain data in MIME format, other formats are not supported. MIME files often have the '.eml' extension and are produced by Outlook Express. In contrast, Outlook produces '.msg' files that are not MIME files and therefore cannot be sent using this method.

If the sender address argument is null (Nothing in Visual Basic), it is taken from the from the "Sender" header field or from the first address in the "From" field if the "Sender" is missing.
If the sender address argument is empty string, it means null sender - same behavior as if "<>" would be specified.
If the recipients argument is null (Nothing in Visual Basic), it overrides the list of recipients contained in the message. If the recipients argument is null, the list of recipients is extracted from "To", "Cc" and "Bcc" header fields.
The "Bcc" field is removed from message headers prior to sending.

Set the AllowNullSender property to allow sending a mail without a sender specified.

Send(MimeMessage, String, Int32)

Sends the message using the specified SMTP server.

Declaration
public static void Send(MimeMessage message, string serverName, int serverPort)
Parameters
Type Name Description
MimeMessage message

Message to be sent.

String serverName

The server address - either a hostname or a dotted string address.

Int32 serverPort

The server port (e.g. 25).

Send(MailMessage, String, Int32)

Sends the message using the specified SMTP server.

Declaration
public static void Send(MailMessage message, string serverName, int serverPort)
Parameters
Type Name Description
MailMessage message

Message to be sent.

String serverName

SMTP server hostname or IP address.

Int32 serverPort

SMTP server port.

Send(String, String, Int32)

Reads a mail message from the specified local file in MIME format and sends it using the specified SMTP server.

Declaration
public static void Send(string fileName, string serverName, int serverPort)
Parameters
Type Name Description
String fileName

The path to the mail message file.

String serverName

SMTP server hostname or IP address.

Int32 serverPort

SMTP server port.

Remarks

The file must be in MIME format, other formats are not supported. MIME files often have the '.eml' extension and are produced by Outlook Express. In contrast, Outlook produces '.msg' files that are not MIME files and therefore cannot be sent using this method.

Both sender and the list of recipients are extracted from the message. The sender address is taken from the "Sender" header field, or from the first address in the "From" field if the "Sender" is missing. The list of recipients comes from "To", "Cc" and "Bcc" header fields. Also, the "Bcc" field is removed from message headers prior to sending.

Send(String, String, String, String, String, Int32)

Sends a mail message constructed from the specified parameters using the specified SMTP server.

Declaration
public static void Send(string from, string to, string subject, string body, string serverName, int serverPort)
Parameters
Type Name Description
String from

Message sender.

String to

Comma-separated list of message recipients.

String subject

The subject of the message.

String body

The text body of the message.

String serverName

The server address - either a hostname or a dotted string address.

Int32 serverPort

The server port (e.g. 25).

Send(MimeMessage, String)

Sends the message using the specified SMTP server.

Declaration
public static void Send(MimeMessage message, string serverName)
Parameters
Type Name Description
MimeMessage message

Message to be sent.

String serverName

The server address - either a hostname or a dotted string address.

Send(MailMessage, String)

Sends the message using the specified SMTP server.

Declaration
public static void Send(MailMessage message, string serverName)
Parameters
Type Name Description
MailMessage message

Message to be sent.

String serverName

SMTP server hostname or IP address.

Send(String, String)

Reads a mail message from the specified local file in MIME format and sends it using the specified SMTP server.

Declaration
public static void Send(string fileName, string serverName)
Parameters
Type Name Description
String fileName

The path to the mail message file.

String serverName

SMTP server hostname or IP address.

Remarks

The file must be in MIME format, other formats are not supported. MIME files often have the '.eml' extension and are produced by Outlook Express. In contrast, Outlook produces '.msg' files that are not MIME files and therefore cannot be sent using this method.

Both sender and the list of recipients are extracted from the message. The sender address is taken from the "Sender" header field, or from the first address in the "From" field if the "Sender" is missing. The list of recipients comes from "To", "Cc" and "Bcc" header fields. Also, the "Bcc" field is removed from message headers prior to sending.

Send(String, String, String, String, String)

Sends a mail message constructed from the specified parameters using the specified SMTP server.

Declaration
public static void Send(string from, string to, string subject, string body, string serverName)
Parameters
Type Name Description
String from

Message sender.

String to

Comma-separated list of message recipients.

String subject

The subject of the message.

String body

The text body of the message.

String serverName

The server address - either a hostname or a dotted string address.

Send(MimeMessage, SmtpConfiguration)

Sends the message using the specified SMTP server.

Declaration
public static void Send(MimeMessage message, SmtpConfiguration configuration)
Parameters
Type Name Description
MimeMessage message

Message to be sent.

SmtpConfiguration configuration

The SmtpConfiguration class.

Send(MailMessage, SmtpConfiguration)

Sends the message using the specified SMTP server.

Declaration
public static void Send(MailMessage message, SmtpConfiguration configuration)
Parameters
Type Name Description
MailMessage message

Message to be sent.

SmtpConfiguration configuration

The SmtpConfiguration class.

Send(String, SmtpConfiguration)

Reads a mail message from the specified local file in MIME format and sends it using the specified SMTP server.

Declaration
public static void Send(string fileName, SmtpConfiguration configuration)
Parameters
Type Name Description
String fileName

The path to the mail message file.

SmtpConfiguration configuration

The SmtpConfiguration class.

Remarks

The file must be in MIME format, other formats are not supported. MIME files often have the '.eml' extension and are produced by Outlook Express. In contrast, Outlook produces '.msg' files that are not MIME files and therefore cannot be sent using this method.

Both sender and the list of recipients are extracted from the message. The sender address is taken from the "Sender" header field, or from the first address in the "From" field if the "Sender" is missing. The list of recipients comes from "To", "Cc" and "Bcc" header fields. Also, the "Bcc" field is removed from message headers prior to sending.

Send(String, String, String, String, SmtpConfiguration)

Sends a mail message constructed from the specified parameters using the specified SMTP server.

Declaration
public static void Send(string from, string to, string subject, string body, SmtpConfiguration configuration)
Parameters
Type Name Description
String from

Message sender.

String to

Comma-separated list of message recipients.

String subject

The subject of the message.

String body

The text body of the message.

SmtpConfiguration configuration

The SmtpConfiguration class.

In This Article
  • Send(MimeMessage, String, String)
  • Send(MailMessage, String, String)
  • Send(MimeMessage)
  • Send(MailMessage)
  • Send(String, String, String, String)
  • Send(Stream, String, String)
  • Send(Stream)
  • Send(String)
  • Send(String, String, String)
  • Send(MimeMessage, String, Int32)
  • Send(MailMessage, String, Int32)
  • Send(String, String, Int32)
  • Send(String, String, String, String, String, Int32)
  • Send(MimeMessage, String)
  • Send(MailMessage, String)
  • Send(String, String)
  • Send(String, String, String, String, String)
  • Send(MimeMessage, SmtpConfiguration)
  • Send(MailMessage, SmtpConfiguration)
  • Send(String, SmtpConfiguration)
  • Send(String, String, String, String, SmtpConfiguration)
© REBEX ČR s.r.o. Back to top
Privacy policy
Manage cookies