mail(subject, text [, to, callback])
Sends an email from your agent and substracts 1 to your daily email counter.
— subject (String)
(String)
Subject of the email.
— text (String)
(String)
Plain text contents of the email.
— to (String)
(String)
Where to send the email (optional).
When omitted, the email will be sent to the address associated with your Phantombuster account.
— callback (Function(err))
(Function(err))
Function called when finished(optional).
err (String)
:null
or a description of what went wrong if something went wrong.
const subject = "Mail subject"
const text = "This a sample text for an email."
const to = "[email protected]"
try {
await buster.mail(subject, text, to)
//The mail is send to [email protected]
} catch (err) {
console.log("Could not send the mail:", err)
}
const subject = "Mail subject"
const text = "This a sample text for an email."
const to = "[email protected]"
buster.mail(subject, text, to)
.then(() => {
//The mail is send to [email protected]
})
.catch((err) => {
console.log("Could not send the mail:", err)
})
var subject = "Mail subject"
var text = "This a sample text for an email."
var to = "[email protected]"
buster.mail(subject, text, to, function(err) {
if (err) {
console.log("Could not send the mail:", err)
} else {
//The mail is send to [email protected]
}
})
![Capture d’écran 2017-04-21 à 1.42.26 PM.png 238](https://files.readme.io/07da56e-Capture_decran_2017-04-21_a_1.42.26_PM.png)