_server.sendMail()
Availability:
SmartFoxServer PRO 1.2.1
Usage:
_server.sendMail(from, to, subject, message)
Description:
Send a text / html formatted email.
Before sending emails you should configure the SMTP server in the config.xml
file.
Properties:
| from | the email address of the sender | |
| to | the email address of the recipient | |
| subject | the subject of the email | |
| message | a text or html message |
Returns:
A boolean value. True if file mail was sent successfully
Example:
/*
* Send an email
*/
var from = "info@gotoandplay.it"
var to = "dickDynamite@mail.com"
var subject = "1, 2, 3 ... check!"
var message = "Hi there! This email was sent from SmartFoxServer!"
var ok = _server.sendMail(from, to, subject, message)
if (ok)
trace("Mail sent!")
else
trace("Ooops! Failed sending mail to: " + to)
See also: