Sending an Email With Authentication

The following code example includes a user name and password to be used by the SMTP server.

import PT_MCF_MAIL:*;

Local PT_MCF_MAIL:MCFOutboundEmail &email = 
create PT_MCF_MAIL:MCFOutboundEmail();
   &email.From = &FromAddress;
   &email.Recipients = &ToList;
   &email.Subject = &Subject;
   &email.Text = &MailBody;
   &email.SMTPServer = "MySMTPServer";
   &email.IsAuthenticationReqd = True;
   &email.SMTPUserName = "SomeLoginName";
   &email.SMTPUserPassword = "SomeLoginPassword";

   Local integer &res = &email.Send();