cordova-plugin-mailcore2
v0.1.3
Published
Cordova plugin that exposes the interface of MailCore2
Downloads
21
Maintainers
Readme
Cordova MailCore2 Plugin
A Cordova plugin that exposes some functions from MailCore2. So far only simple sending of an email is supported. Once it is properly working more functions can/will be added.
Using
Install iOS platform (if not present already):
cordova platform add iosInstall the plugin:
$ cordova plugin add cordova-plugin-mailcore2Alternatively install the plugin directly from GitHub (for the latest version):
$ cordova plugin add https://github.com/CWBudde/cordova-plugin-mailcore2.gitSo far only the mail sending capacibilities of the MailCore2 library are exposed.
Sending an email
To send an email you must first provide the required options as such
var mailSettings = {
fromEmail: "[email protected]",
toName: "Name of the Receiver",
toEmail: "[email protected]",
smtpServer: "smtp-mail.domain.com",
smtpPort: 465,
smtpUserName: "[email protected]",
smtpPassword: "password",
textSubject: "email subject",
textBody: "email body"
};
var success = function {
// message sent
}
var failure = function(error) {
console.log("Error sending the email");
}You can also add an attachment. However, so far it's just possible to add one attachment and it must be preformated. For example if you want to attach an image it needs to be surrounded by the img tag like this:
textAttachment: "<img src='data:image/jpeg;base64,...' />"This simple API might get changed in the future.
