public class MailService
extends java.lang.Object
Constructor and Description |
---|
MailService() |
Modifier and Type | Method and Description |
---|---|
void |
addFrom(Address address)
Adds a 'from' value
|
void |
addTo(Address address)
Adds a 'to' value
|
Address[] |
getFromAddresses() |
Session |
getSession()
Gets the mail session
|
Address[] |
getToAddresses() |
void |
init() |
void |
send(Message message)
Sends to a mailbox
|
void |
send(java.lang.String body)
Sends to a mailbox
|
void |
send(java.lang.String subject,
java.lang.String body)
Sends to a mailbox
|
void |
sendWithAttachment(java.lang.String subject,
java.lang.String textBody,
java.lang.String attachmentType,
java.lang.String attachmentName,
java.io.InputStream is)
Sends to a mailbox
|
void |
setProperties(java.util.Properties props)
Sets properties
|
void |
setProperty(java.lang.String key,
java.lang.String value)
Sets a property
|
void |
setSession(Session session)
Sets the mail session
|
void |
setSubject(java.lang.String subject)
Sets the subject
|
java.lang.String |
toString() |
public void setSession(Session session)
public Session getSession()
public void addTo(Address address)
public Address[] getToAddresses()
public void addFrom(Address address)
public Address[] getFromAddresses()
public void setProperty(java.lang.String key, java.lang.String value)
public void setProperties(java.util.Properties props)
public void setSubject(java.lang.String subject)
public void send(java.lang.String body)
public void send(java.lang.String subject, java.lang.String body)
public void sendWithAttachment(java.lang.String subject, java.lang.String textBody, java.lang.String attachmentType, java.lang.String attachmentName, java.io.InputStream is)
public void send(Message message)
public void init()
public java.lang.String toString()
toString
in class java.lang.Object