Package com.codename1.messaging
package com.codename1.messaging
Send e-mail messages through underlying platforms e-mail clients or thru the Codename One cloud.
You can send messages and include attachments by using the platform native email client like this:
Message m = new Message("Body of message");
m.getAttachments().put(textAttachmentUri, "text/plain");
m.getAttachments().put(imageAttachmentUri, "image/png");
Display.getInstance().sendMessage(new String[] {"[email protected]"}, "Subject of message", m);
The following code demonstrates sending an email via the Codename One cloud, notice that this is a pro specific feature:
Message m = new Message("Check out Codename One");
m.setMimeType(Message.MIME_HTML);
// notice that we provide a plain text alternative as well in the send method
boolean success = m.sendMessageViaCloudSync("Codename One", "[email protected]", "Name Of User", "Message Subject",
"Check out Codename One at https://www.codenameone.com/");
-
ClassesClassDescriptionRepresents a message to be sent using underlying platform e-mail client or the cloud.