SmtpMessage Property
Gets or sets the mail message which will be sent by the component on Send method call.

Namespace: MailBee.SmtpMail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax
public MailMessage Message { get; set; }

Property Value

Type: MailMessage
The MailMessage object representing the mail message which will be sent by the component on Send method call.
Exceptions
ExceptionCondition
MailBeeInvalidArgumentExceptionvalue is a null reference (Nothing in Visual Basic).
Remarks

The developer can also use Message property to access those methods and properties of the message to be sent which are not available in Smtp class itself. For instance, LoadBodyText(String, MessageBodyType, Encoding, ImportBodyOptions) method is not available in Smtp class, and must be called as Smtp.Message.LoadBodyText(parameters).

Some most often used members of MailMessage object are available through Smtp class members. For instance, the following notations are equivalent: Smtp.Message.BodyHtmlText and Smtp.BodyHtmlText.

Examples
This sample composes the message by downloading the message body from a web page, and sends the message to a relay SMTP server (direct send mode is not used).
// To use the code below, import MailBee namespaces at the top of your code.
using MailBee;
using MailBee.SmtpMail;
using MailBee.Mime;

// The actual code (put it into a method of your class)

Smtp mailer = new Smtp();

// Specify SMTP server to use. If your server does not require authentication, 
// just remove last 2 parameters.
mailer.SmtpServers.Add("smtp.domain.com", "jdoe", "secret");

// Compose the message.
mailer.From.AsString = "John Doe <jdoe@domain.com>";
mailer.To.AsString = "Support Team <support@afterlogic.com>";
mailer.Subject = "Error on your homepage";

mailer.Message.LoadBodyText("http://www.afterlogic.com", MessageBodyType.Html);

// Send it.
mailer.Send();
See Also