SmtpFrom Property
Gets or sets EmailAddress object specifying the message sender.

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

Property Value

Type: EmailAddress
The EmailAddress object representing From: field of the message.
Remarks
This property is equivalent to From property of Message object.
Examples
Setting the message sender using different methods.
// 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>";
See Also