Skip to content

Email sending

Igor Balos edited this page Nov 9, 2017 · 24 revisions

With Postmark you can send email super easy. Before diving into this chapter, make sure you have checked out our getting started page.

To send a simple email, you do the following:

String htmlBody = "<!DOCTYPE html><html><body>" +
"<p>Hello<a href=\"http://www.google.com\">world</a></p></body></html>";
        
// create a simple email message
Message message = new Message("[email protected]", "[email protected]", "Hello from Postmark!", htmlBody);
message.setReplyTo("[email protected]");

// Deliver a simple message
MessageResponse response = client.deliverMessage(message);
System.out.println(response.getMessage());