Advertisement
Guest User

Untitled

a guest
Aug 31st, 2017
531
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. CloudRail.setAppKey("[Login to see your license key]");
  2.  
  3. Email service;
  4.  
  5. MailJet mailjet = new MailJet(
  6. this,
  7. "[Mailjet API Key]",
  8. "[Mailjet API Private Key]"
  9. );
  10.  
  11. service = mailjet;
  12.  
  13. InputStream inputstream = new FileInputStream("MyFile.pdf");
  14. String mimeType = "application/pdf";
  15. String filename = "MyFile.pdf";
  16. ArrayList<Attachment> attachments = new ArrayList<>();
  17.  
  18. attachments.add(new Attachment(
  19. inputstream,
  20. mimeType,
  21. filename
  22. ));
  23.  
  24. service.sendEmail(
  25. "info@cloudrail.com",
  26. "CloudRail",
  27. new ArrayList<>() {"your_name@gmail.com"},
  28. "CloudRail is awesome",
  29. "Hi there,\n\nGo ahead and try it yourself!",
  30. "<strong>Go ahead and try it yourself!</strong>",
  31. new ArrayList<>() {"your_cc_name@gmail.com"},
  32. new ArrayList<>() {"your_bcc_name@gmail.com"},
  33. attachments
  34. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement