// tag::buildAndSendMail[] public void DoBuildAndSendMail(MailMan m, string firstName, string lastName, string division, string subject, MailFont font, string message1, string message2, string message3) { // Format the email address string mId = firstName[0] + "." + lastName.Substring(0, 7) + "@" + division.Substring(0, 5) + ".compa.ny"; // Format the message given the content type and raw message MailMessage mMessage = FormatMessage(font, message1 + message2 + message3); // Send message m.Send(mId, subject, mMessage); }
public void DoBuildAndSendMail(MailMan m, Mail mail) { // Format the email address string mId = $"{mail.firstName[0]}.{mail.lastName.Substring(0, 7)}" + $"@{mail.division.Substring(0, 5)}.compa.ny"; // Format the message given the content type and raw message MailMessage mMessage = FormatMessage(mail.font, mail.message1 + mail.message2 + mail.message3); // Send message m.Send(mId, mail.subject, mMessage); }
// tag::buildAndSendMail[] public void DoBuildAndSendMail(MailMan m, string firstName, string lastName, string division, string subject, MailFont font, string message1, string message2, string message3) { // Format the email address string mId = $"{firstName[0]}.{lastName.Substring(0, 7)}" + $"@{division.Substring(0, 5)}.compa.ny"; // Format the message given the content type and raw message MailMessage mMessage = FormatMessage(font, message1 + message2 + message3); // Send message m.Send(mId, subject, mMessage); }