EmailUtils.notNull(aSession, "no mail session supplied");
/** * Sends the previously created MimeMessage to the SMTP server. * * @return the message id of the underlying MimeMessage * @throws IllegalArgumentException if the MimeMessage has not been created * @throws EmailException the sending failed */ public String sendMimeMessage() throws EmailException { EmailUtils.notNull(this.message, "MimeMessage has not been created yet"); try { Transport.send(this.message); return this.message.getMessageID(); } catch (final Throwable t) { final String msg = "Sending the email to the following server failed : " + this.getHostName() + ":" + this.getSmtpPort(); throw new EmailException(msg, t); } }
EmailUtils.notNull(aSession, "no mail session supplied");
/** * Sends the previously created MimeMessage to the SMTP server. * * @return the message id of the underlying MimeMessage * @throws IllegalArgumentException if the MimeMessage has not been created * @throws EmailException the sending failed */ public String sendMimeMessage() throws EmailException { EmailUtils.notNull(this.message, "MimeMessage has not been created yet"); try { Transport.send(this.message); return this.message.getMessageID(); } catch (final Throwable t) { final String msg = "Sending the email to the following server failed : " + this.getHostName() + ":" + this.getSmtpPort(); throw new EmailException(msg, t); } }