Here you can find the source of sendBulkUpdateFailureNotice(final String msgBody)
public static boolean sendBulkUpdateFailureNotice(final String msgBody)
//package com.java2s; /*/*from ww w. j a v a 2 s . co m*/ * Copyright (c) 2013 IANA. All Rights Reserved. THE AUTHOR MAKES NO * REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE, EITHER * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. THE * AUTHOR SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT * OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. */ import java.util.Properties; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.PasswordAuthentication; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; public class Main { private static Properties emailProps = new Properties(); public static boolean sendBulkUpdateFailureNotice(final String msgBody) { Session session = Session.getInstance(emailProps, new javax.mail.Authenticator() { @Override protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication("", ""); } }); try { Message message = new MimeMessage(session); message.setFrom(new InternetAddress("admin@dver.intermodal.org")); message.addRecipients(Message.RecipientType.TO, new InternetAddress[] { new InternetAddress( "admin@dver.intermodal.org") }); message.setSubject("Bulk DVER Update via XLS failure notice:"); message.setText(msgBody); message.setContent(msgBody, "text/html"); Transport.send(message); return true; } catch (MessagingException e) { e.getMessage(); return false; } } }