Created
August 8, 2013 17:12
-
-
Save desireesantos/6186603 to your computer and use it in GitHub Desktop.
HtmlEmail - Criar email com arquivo anexado
This file contains 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.trailblazers.freewheelers.model; | |
import org.apache.commons.mail.EmailException; | |
import org.apache.commons.mail.HtmlEmail; | |
import static com.trailblazers.freewheelers.model.SetupMail.*; | |
public class SendFileInMail { | |
private HtmlEmail email; | |
public SendFileInMail() { | |
this(new HtmlEmail()); | |
} | |
public SendFileInMail(HtmlEmail email) { | |
this.email = email; | |
} | |
public HtmlEmail create() throws EmailException { | |
email.setHostName(HOSTNAME); | |
email.setSmtpPort(PORT); | |
email.setFrom(EMAIL_FROM); | |
email.setSSLOnConnect(false); | |
email.setStartTLSEnabled(false); | |
return email; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment