-
Notifications
You must be signed in to change notification settings - Fork 6
- Email.addAttachment
- Email.addBcc
- Email.addCc
- Email.addExternalImage
- Email.addHTMLHeader
- Email.addHeader
- Email.addTo
- Email.email
- Email.embedFile
- Email.embedURL
- Email.getEmailObj
- Email.send
- Email.setCharset
- Email.setContent
- Email.setCredentials
- Email.setFrom
- Email.setHTML
- Email.setMessage
- Email.setPort
- Email.setSubject
Email.addAttachment(aPath, isInline, noDisposition, aName) : Email
Adds aPath file as an attachment for the current email. Optionally you can specify if it's an inline (isInline) attachment; noDisposition = true to not set it as inline or attachment (ignores isInline); an internal aName.
Email.addBcc(aBccOrList) : Email
Sets the current email bcc email address or an array of bcc email addresses.
Email.addCc(aCcOrList) : Email
Sets the current email cc email address or an array of cc email addresses.
Email.addExternalImage(aURL) : Email
Retrieves an external image from aURL and set's everything for that URL to be used in HTML. Only available if the Email object was initialized with isHtml = true.
Email.addHTMLHeader() : Email
(deprecation) Please use the option in the constructor and the setHTML function. Adds the necessary headers to support HTML contents. To be deprecated in the future. Please use new Email with isHTML = true and the setHTML function.
Email.addHeader(aKey, aValue) : Email
Add a SMTP header with aKey and the corresponding aValue.
Email.addTo(aToOrList) : Email
Sets the current email "To" email address or an array of "To" email addresses.
Email.email(aServer, aSenderAddress, shouldSecure, useTLS, isHTML)
Creates a Email object instance using the aServer SMTP server to send email with the from field set to aSenderAddress. Optionally you can specify if a secure protocol (SSL) should be used with shouldSecure = true, to TLS add shouldSecure = true and useTLS = true and isHTML to use the setHTML function later.
Email.embedFile(aFilePath, aName) : Email
Tries to embed aFilePath with aName and returns the cid to be used in HTML (e.g. img src="cid:xxx"). Only available if the Email object was initialized with isHtml = true.
Email.embedURL(aURL, aName) : Email
Tries to embed aURL with aName and returns the cid to be used in HTML (e.g. img src="cid:xxx"). Only available if the Email object was initialized with isHtml = true.
Email.getEmailObj() : JavaObject
Returns the internal Java object used to composed the email message for advance usage. See more in https://commons.apache.org/proper/commons-email/apidocs/org/apache/commons/mail/Email.html.
Email.send(aSubject, aMessage, aToList, aCCList, aBCCList, aSender) : String
Sends an email with aSubject and aMessage to the provided array of aToList, aCCList and aBCCList. Optionally you can specify a from address in aSender, otherwise the default for this object instance will be used. Returns the id of the message sent.
Email.setCharset(aCharset) : Email
Sets the current email aCharset to use.
Email.setContent(aContent, aContentType) : Email
Sets the current email body message to send with aContent string. Specifies also that the corresponding content type is aContentType.
Email.setCredentials(aLogin, aPassword, aProtocol)
Sets the credentials to use when using a SMTP server which activates the use of a secure protocol (TLS/SSL) if available.
Email.setFrom(aFrom) : Email
Sets the current email aFrom email address.
Email.setHTML(aHTML) : Email
If the Email object was initialized with isHtml = true then will set the HTML content to aHTML.
Email.setMessage(aMessage) : Email
Sets the current email body message to send (raw). Please use Email.setContent to specify the mime type. For emails initialized with isHtml = true, sets the alternative text content to show.
Email.setPort(aPort)
Sets aPort to contact the SMTP server.
Email.setSubject(aSubject) : Email
Sets the email's aSubject;