Skip to content

Instantly share code, notes, and snippets.

@carstenjacobsen
Created August 31, 2017 19:27
Show Gist options
  • Save carstenjacobsen/de46d6d674c79c12c30abb75e3de7b1a to your computer and use it in GitHub Desktop.
Save carstenjacobsen/de46d6d674c79c12c30abb75e3de7b1a to your computer and use it in GitHub Desktop.
CloudRail.setAppKey("[Login to see your license key]");
Email service;
MailJet mailjet = new MailJet(
this,
"[Mailjet API Key]",
"[Mailjet API Private Key]"
);
service = mailjet;
InputStream inputstream = new FileInputStream("MyFile.pdf");
String mimeType = "application/pdf";
String filename = "MyFile.pdf";
ArrayList<Attachment> attachments = new ArrayList<>();
attachments.add(new Attachment(
inputstream,
mimeType,
filename
));
service.sendEmail(
"info@cloudrail.com",
"CloudRail",
new ArrayList<>() {"your_name@gmail.com"},
"CloudRail is awesome",
"Hi there,\n\nGo ahead and try it yourself!",
"<strong>Go ahead and try it yourself!</strong>",
new ArrayList<>() {"your_cc_name@gmail.com"},
new ArrayList<>() {"your_bcc_name@gmail.com"},
attachments
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment