Kraken Mail
Install
kraken@Future bin> bundle.install org.krakenapps kraken-mail 1.1.0 Resolving org.krakenapps/kraken-mail (1.1.0) -> trying to download from http://download.krakenapps.org/ bundle [50] loaded kraken@Future bin> bundle.start 50 bundle 50 started.
Service Interface
Use MailerRegistry OSGi service interface for mailing:
public interface MailerRegistry {
Collection<MailerConfig> getConfigs();
MailerConfig getConfig(String name);
void register(MailerConfig config);
void unregister(String name);
Session getSession(MailerConfig config);
void send(MailerConfig config, String from, String to, String subject, String message) throws MessagingException;
}
How to use Gmail SMTP
For this example, I will use my gmail account, xeraph@nchovy.com. Add new mailer configuration:
kraken@Future bin> mailer.register Name? googleapps SMTP Server? smtp.gmail.com SMTP Port? 587 SMTP User? xeraph@nchovy.com SMTP Password? new configuration added
Check mailer configuration list:
kraken@Future bin> mailer.list Configurations ------------------ [googleapps]smtp, smtp.gmail.com:587 user: xeraph@nchovy.com
Write email:
kraken@Future bin> mailer.send googleapps From? xeraph@nchovy.com To? xeraph@nchovy.com Subject? hello there Enter message, end with "." on a line by itself. test test . sending... complete
Result:
Attachments
-
hellothere.png
(5.4 KB) -
added by xeraph 4 months ago.

