SMTP Client
CSML includes a native SMTP client, allowing you to easily send emails from your chatbot.
1
do email = {
2
// required
3
"from": "John <[email protected]>",
4
"to": "Jane <[email protected]>",
5
6
// either html or text is required, both can be set
7
"html": "<h1>Hello in HTML!</h1>",
8
"text": "Hi there in plain text",
9
10
// optional
11
"reply_to": "Iron Man <[email protected]>",
12
"bcc": "James <[email protected]>",
13
14
"subject": "Happy new year",
15
}
16
17
do SMTP(hostname) // mandatory
18
.auth(username, password) // optional, defaults to no auth
19
.tls(true) // optional, defaults to auto upgrade to TLS if available
20
.port(465) // optional, defaults to 465
21
.send(email) // perform the send request
22
Copied!
Last modified 3mo ago
Export as PDF
Copy link