This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static void sendMail(String subject, String message, byte[] attachement, String fileName, String contentType, String from, String[] to) { | |
| try { | |
| // JavaMail representation of the message | |
| Session s = Session.getInstance(new Properties(), null); | |
| MimeMessage mimeMessage = new MimeMessage(s); | |
| // Sender and recipient | |
| mimeMessage.setFrom(new InternetAddress(from)); | |
| for (String toMail : to) { | |
| mimeMessage.addRecipient(javax.mail.Message.RecipientType.TO, new InternetAddress(toMail)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.tabuleapp.SendGrid; | |
| import javax.mail.Authenticator; | |
| import javax.mail.BodyPart; | |
| import javax.mail.Message; | |
| import javax.mail.MessagingException; | |
| import javax.mail.Multipart; | |
| import javax.mail.PasswordAuthentication; | |
| import javax.mail.Session; | |
| import javax.mail.Transport; |