firemail allows you to send e-mails from a FirefoxOS app with ease
See example app for a complete example of sending a formatted mail with firemail
from FirefoxOS.
Dependencies for firemail
:
- mimefuncs - Encode and decode quoted printable and base64 strings
- mimetypes - Convert extensions to Content-Type values and vice versa
- addressparser - Parse e-mail address lists
- mailcomposer - Compose e-mails
- smtpclient - SMTP client for FirefoxOS
Install with volo:
volo add Kreata/firemail/v0.1.1
Require firemail.js as firemail
Opening TCP sockets to a SMTP server requires special privileges. You need to set the type of your application to "privileged" and add "tcp-socket" to the permissions list in the application manifest.
{
"type" : "privileged",
"permissions": {
"tcp-socket": {
"description" : "SMTP access"
}
},
...
}
firemail({
stmp:{
host: "smtp.gmail.com",
useSSL: true,
auth: {
user: "yourgmail@user",
pass: "password"
}
},
from: "[email protected]",
to: "[email protected]",
subject: "test message",
text: "Hello world!",
html: "<b>Hello world!</b>"
}, function(err, success){
alert(err || success);
});
Unit tests for firemail reside in the example app.
MIT