With JSMA mail you can send an email
What can JSMA mail do for me?The JSMA mail lets you dispatch multipart emails allowing you to send a plain text body and attachments along with your HTML email. |
The JSMA mail provides the following methods:
Dispatches an email to one or multiple recipients.
Returns true if sending was successful, or false if it wasn't.
else if (itemAction === "recommendFriends") { var recommendationName = request.parameter("rn"); var recommendationFriends = request.parameter("rf"); var recommendationMessage = request.parameter("rm"); var portal = getCurrentPortal(); var mailTemplateBodyName = portal.get("customers.recommendFriendsMailBody"); var mailTemplateSubjectName = portal.get("customers.recommendFriendsMailSubject"); var mailSender = portal.get("service.mail"); var mailSenderName = portal.get("service.mailSender"); var mailTemplateBody = contents.findByName(mailTemplateBodyName); var mailTemplateSubject = contents.findByName(mailTemplateSubjectName); [...] var recommendationFriendMails = recommendationFriends.split(","); for (var i=0;i<recommendationFriendMails.length;i++) { var recommendationFriendMail = recommendationFriendMails[i].trim(); mail.send(recommendationFriendMail, mailTemplateSubject.content, mailTemplateBody.content, mailSenderName, mailSender); } [...] } |
A string or an array of strings which will be used as email recipients.
The email subject
The email body.
The name that will displayed next to the sender's email address.
The email address that will be used in the FROM field of the message.
An alternative plaintext body for the message.
A JSMA portal from which the smpt credentials shall be used.
A single JSMA file or a list.
The file(s) will be used as attachment(s) in the message.