SmtpFrom Property |
Namespace: MailBee.SmtpMail
// 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>";