Skip to content

osvegis/mailer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

Mailer

Basic SMTP client for Java

Mailer is built on top of Apache Commons Net API.

This library is sponsored by Tetra Informática, S.L.

Example of using the Mailer library

String smtpHost = "?",
       smtpUser = "?",
       password = "?",
       mailFrom = "?",
       mailTo   = "?";

try(Mailer mailer = new Mailer(smtpHost, 587, smtpUser, password,
                               Security.TLS, false, mailFrom))
{
    // A single message.
    mailer.send(mailTo, "Message subject", "Message text");

    // A message with attached files
    mailer.send(mailTo, "Message subject", "Message text",
                new Attachment(new File("pathname1")),
                new Attachment(new File("pathname2")));

    // Send an EML file written with Thunderbird.
    mailer.send(mailTo, new File("EML file path"));
}

About

Basic SMTP client for Java

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages