public class Mail extends Object
| Constructor and Description |
|---|
Mail() |
| Modifier and Type | Method and Description |
|---|---|
String |
getTemplate() |
Mail |
isHtml()
Mark the mail as an HTML mail
|
static Mail |
newHtmlMail() |
static Mail |
newMail() |
void |
send()
Sends the mail
|
Mail |
withAttachment(File file)
Adds a file attachment to the mail
|
Mail |
withBCC(String recipient)
Adds a bcc recipient to the mail
|
Mail |
withBody(String body)
Adds a custom to the mail
This will overwrite rendering of the template!
|
Mail |
withCC(String recipient)
Adds a cc recipient to the mail
|
Mail |
withContent(String key,
Object value)
Adds content to the template which will be rendered
|
Mail |
withFrom(String from)
Adds the from address to the mail
|
Mail |
withRecipient(String recipient)
Adds a recipient to the mail
|
Mail |
withSubject(String subject)
Adds a subject to the mail
|
Mail |
withTemplate(String template)
Add a template to the mail which will be rendered before the mail is send
|
public static Mail newMail()
public static Mail newHtmlMail()
public Mail withRecipient(String recipient)
recipient - The mail address of the recipientpublic Mail withCC(String recipient)
recipient - The mail address of the cc recipientpublic Mail withSubject(String subject)
subject - The subject of the emailpublic Mail withTemplate(String template)
template - The path to the template fail (e.g. emails/mail.ftl)public String getTemplate()
public Mail withBCC(String recipient)
recipient - The subject of the emailpublic Mail withBody(String body)
body - The body of the emailpublic Mail withFrom(String from)
from - The from address, e.g. jon.snow@winterfell.compublic Mail withAttachment(File file)
file - The file to addpublic Mail isHtml()
public Mail withContent(String key, Object value)
key - The keyvalue - The valuepublic void send()
throws MangooMailerException
MangooMailerException - when sending the mail failedCopyright © 2016. All rights reserved.