SysMailer mailer = new SysMailer();
SysEmailParameters parameters = SysEmailParameters::find();
;
if (parameters.SMTPRelayServerName)
{
mailer.SMTPRelayServer(parameters.SMTPRelayServerName,
parameters.SMTPPortNumber,
parameters.SMTPUserName,
SysEmailParameters::password(),
parameters.NTLM);
}
else
{
mailer.SMTPRelayServer(parameters.SMTPServerIPAddress,
parameters.SMTPPortNumber,
parameters.SMTPUserName,
SysEmailParameters::password(),
parameters.NTLM);
}
mailer.fromAddress('hesham.elgabarty@augpharma.com');
mailer.tos().appendAddress('hesham.elgabarty@augpharma.com');
mailer.htmlBody('AZZZ');
mailer.subject('Comunicazione AX');
mailer.sendMail();
info('Done');
SysEmailParameters parameters = SysEmailParameters::find();
;
if (parameters.SMTPRelayServerName)
{
mailer.SMTPRelayServer(parameters.SMTPRelayServerName,
parameters.SMTPPortNumber,
parameters.SMTPUserName,
SysEmailParameters::password(),
parameters.NTLM);
}
else
{
mailer.SMTPRelayServer(parameters.SMTPServerIPAddress,
parameters.SMTPPortNumber,
parameters.SMTPUserName,
SysEmailParameters::password(),
parameters.NTLM);
}
mailer.fromAddress('hesham.elgabarty@augpharma.com');
mailer.tos().appendAddress('hesham.elgabarty@augpharma.com');
mailer.htmlBody('AZZZ');
mailer.subject('Comunicazione AX');
mailer.sendMail();
info('Done');