Hello Everyone,
Can we attach multiple files using SysMailer class ? Below is the code sample am using to send the email, where i need to send multiple files as attachment\
mailer = New SysMailer();
mailer.fromAddress(SysEmailTable::find(EmailId).SenderAddr,SysEmailTable::find(EmailId).SenderName);
mailer.tos().appendAddress(_documentsDetailsTmp.EmailId);
EmailCC = strFmt("CustOps@power.com;%1",worker.email());
splitEmailCC = strSplit(EmailCC,";");
lenum = splitEmailCC.getEnumerator();
while(lenum.moveNext())
{
mailer.ccs().appendAddress(lenum.current());
}
//Subject
message = SysEmailMessageTable::find(EmailId, LanguageId).Subject;
message = SysEmailMessage::stringExpand(message,mappings);
mailer.subject(message);
//Body
messageBody = SysEmailMessageTable::find(EmailId, LanguageId).Mail;
messageBody = SysEmailMessage::stringExpand(messageBody, SysEmailTable::htmlEncodeParameters(mappings));
messageBody = strReplace(messageBody, '\n', '<br>');
mailer.htmlBody(messageBody);
//Send Email
mailer.SMTPRelayServer(SysEmailParameters::find().SMTPRelayServerName,
SysEmailParameters::find().SMTPPortNumber,
SysEmailParameters::find().SMTPUserName,SysEmailParameters::password(),
SysEmailParameters::find().NTLM);
mailer.attachments().add(); //Using this, we can send one file as attachment
mailer.sendMail();
Please help me to understand, how can we send multiple files. Thank you in advance !!
Regards,
Venkat