Provides methods for working with email via IMAP.
getLastEmail
Retrieves last unseen email.
** Usage example:**
Parameters:
sinceMinutes
Number
Search for emails received since the specified amount of minutes into past.
subject
String
|Regex
Return email matching the specified subject.
timeout
Number
Timeout (in milliseconds) for waiting for the message to arrive.
Returns:
Object
- Email body, text, textAsHtml, attachments if any, and TO, FROM, SUBJECT, DATE headers.
init
Set email connection details.
Parameters:
user
String
Username (e.g. 'your@email.address').
password
String
Password.
host
String
Host name (e.g. 'imap.gmail.com').
port
Number
Port number (e.g. 993).
tls
Boolean
true to use TLS, false otherwise.
authTimeout
Number
optional
Authentication timeout in milliseconds.
enableSNI
Boolean
optional
Enable sending SNI when establishing the connection. This is required for some mail servers. Default is false.
send
Send email using SMTP.
Parameters:
to
String
|Array
Receiver's email address.
subject
String
Email subject.
content
String
Email body as a plain text.
html
String
optional
Optional, Email body as HTML.
Last updated