Using an SSL Connection to Send Email

The following code example uses an SSL connection to send an email message:

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";
&email.SMTPUseSSL = "Y";
&email.SMTPSSLClientCertAlias = &cAlias;
&email.SMTPSSLPort = &SSLPort; 

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