mail()

mail(subject, text [, to, callback])

Sends an email from your agent and substracts 1 to your daily email counter.

— subject (String)

Subject of the email.

— text (String)

Plain text contents of the email.

— to (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 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]
  }
})
238