mail.smtp.starttls.enable=true
Took me a little while of digging on the Internet and trying stuff to get it to work. So, for this week's tip - I thought it might be a good idea to share the code:
function sendEmailUsingGmail()
{
var properties = new Array();
properties[0] = 'mail.smtp.host=smtp.gmail.com';
properties[1] = 'mail.smtp.port=587';
properties[2] = 'mail.smtp.auth=true';
properties[3] = 'mail.smtp.username=
properties[4] = 'mail.smtp.password=
properties[5] = 'mail.smtp.starttls.enable=true';
var msgText = 'test message';
var success = plugins.mail.sendMail('tosomeone@gmail.com', 'fromsomeone@gmail.com', 'subject', msgText, null, null, null, properties);
if (!success)
{
plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK');
}
}
Enjoy!
No comments:
Post a Comment