Gets or sets EmailAddress object specifying the message sender.
The EmailAddress object representing From: field of the message.
This property is equivalent to From property of Message object.
Setting the message sender using different methods.
[C#] // 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(); // Method 1: Setting Display Name and E-mail separately. mailer.From.DisplayName = "John Doe, Sales Manager"; mailer.From.Email = "jdoe@domain.com"; // Method 2: Setting From field as string. mailer.From.AsString = "\"John Doe, Sales Manager\" <jdoe@domain.com>"; // Method 3: Setting From field as EmailAddress. mailer.From = new EmailAddress("John Doe, Sales Manager", "jdoe@domain.com"); // Method 4: Setting From field using Headers collection. mailer.Message.Headers["From"] = "\"John Doe, Sales Manager\" <jdoe@domain.com>";
[Visual Basic] ' To use the code below, import MailBee namespaces at the top of your code. Imports MailBee Imports MailBee.SmtpMail Imports MailBee.Mime ' The actual code (put it into a method of your class) Dim mailer As New Smtp ' Method 1: Setting Display Name and E-mail separately. mailer.From.DisplayName = "John Doe, Sales Manager" mailer.From.Email = "jdoe@domain.com" ' Method 2: Setting From field as string. mailer.From.AsString = """John Doe, Sales Manager"" <jdoe@domain.com>" ' Method 3: Setting From field as EmailAddress. mailer.From = New EmailAddress("John Doe, Sales Manager", "jdoe@domain.com") ' Method 4: Setting From field using Headers collection. mailer.Message.Headers("From") = """John Doe, Sales Manager"" <jdoe@domain.com>"
Smtp Class | MailBee.SmtpMail Namespace