Class Nodemailer
- Defined in: mail.js
Constructor Attributes | Constructor Name and Description |
---|---|
Nodemailer(options)
Generates a Nodemailer object which is the main 'hub' for managing the send process |
Method Summary
Class Detail
Generates a Nodemailer object which is the main 'hub' for managing the send process
- Parameters:
- {Object} options
- Message options object, see README for the complete list of possible options
Method Detail
-
generateMailObject()
Uses the data from the original options object to compose a mailcomposer e-mail message that can be later streamed to the selected transport
-
{Object} getGlobalTransport()
Add support for legacy transport settings by checking for global variables SMTP, sendmail and SES
- Returns:
- {Object} Transport object
-
sendMail(callback)
Send the e-mail message by using data from the original options object and selected transport
- Parameters:
- {Function} callback
- Callback function to run when the e-mail has been sent (or it failed)
-
setAttachments()
If attachment array is set on the options object, add these attachments to the mailcomposer object
-
setGeneralOptions()
Uses the general options (message sender and receiver, subject body, etc.) to set mailcomposer properties. Includes support for legacy properties.
-
setModuleHeaders()
Add some required headers to the message, such as Date: and Message-Id:
-
setUserHeaders()
If the 'headers' property was set on the options, add the values to the header of the e-mail message
-
validateSettings(callback)
Doesn't do much currently, if the future should link to transport validation methods. For example in case of SES should check that AWS keys are set up etc.
- Parameters:
- {Function} callback
- Callback function to run after validation