|
Adempiere 3.5.2a | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compiere.util.EMail
public final class EMail
EMail Object. Resources: http://java.sun.com/products/javamail/index.html http://java.sun.com/products/javamail/FAQ.html
When I try to send a message, I get javax.mail.SendFailedException:
550 Unable to relay for my-address
This is an error reply from your SMTP mail server. It indicates that
your mail server is not configured to allow you to send mail through it.
| Field Summary | |
|---|---|
static String |
HTML_MAIL_MARKER
|
protected static CLogger |
log
Logger |
static String |
SENT_OK
Mail Sent OK Status |
| Constructor Summary | |
|---|---|
EMail(MClient client,
String from,
String to,
String subject,
String message)
Full Constructor |
|
EMail(MClient client,
String from,
String to,
String subject,
String message,
boolean html)
Full Constructor |
|
EMail(Properties ctx,
String smtpHost,
String from,
String to,
String subject,
String message)
Full Constructor |
|
EMail(Properties ctx,
String smtpHost,
String from,
String to,
String subject,
String message,
boolean html)
Full Constructor |
|
| Method Summary | |
|---|---|
void |
addAttachment(byte[] data,
String type,
String name)
Add attachment. |
void |
addAttachment(DataSource dataSource)
Add arbitary Attachment |
void |
addAttachment(File file)
Add file Attachment |
void |
addAttachment(URL url)
Add url based file Attachment |
void |
addAttachments(Collection<File> files)
Add a collection of attachments |
boolean |
addBcc(String newBcc)
Add BCC Recipient |
boolean |
addCc(String newCc)
Add CC Recipient |
boolean |
addTo(String newTo)
Add To Recipient |
EMailAuthenticator |
createAuthenticator(String username,
String password)
Create Authenticator for User |
InternetAddress[] |
getBccs()
Get BCC Recipients |
InternetAddress[] |
getCcs()
Get CC Recipients |
InternetAddress |
getFrom()
Get Sender |
String |
getMessageCRLF()
Get MIME String Message - line ending with CRLF. |
String |
getMessageHTML()
Get HTML Message |
String |
getMessageID()
Get Message ID or null |
protected MimeMessage |
getMimeMessage()
Get the message directly |
InternetAddress |
getReplyTo()
Get Reply To |
String |
getSentMsg()
Get Send Result Msg |
String |
getSmtpHost()
Get Mail Server name or address |
String |
getSubject()
Get Subject |
InternetAddress |
getTo()
Get Recipient |
InternetAddress[] |
getTos()
Get TO Recipients |
boolean |
isSentOK()
Was sending the Msg OK |
boolean |
isValid()
Is Info valid to send EMail |
boolean |
isValid(boolean recheck)
Re-Check Info if valid to send EMail |
static void |
main(String[] args)
Test. |
String |
send()
Send Mail direct |
void |
setFrom(String newFrom)
Set Sender |
void |
setMessageHTML(String html)
Set HTML Message |
void |
setMessageHTML(String subject,
String message)
Set HTML Message |
void |
setMessageText(String newMessage)
Set Message |
boolean |
setReplyTo(String newTo)
Set Reply to Address |
void |
setSmtpHost(String newSmtpHost)
Set SMTP Host or address |
void |
setSubject(String newSubject)
Set Subject |
String |
toString()
String Representation |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String HTML_MAIL_MARKER
public static final String SENT_OK
protected static CLogger log
| Constructor Detail |
|---|
public EMail(MClient client,
String from,
String to,
String subject,
String message)
client - the clientfrom - Sender's EMail addressto - Recipient EMail addresssubject - Subject of messagemessage - The message
public EMail(MClient client,
String from,
String to,
String subject,
String message,
boolean html)
client - the clientfrom - Sender's EMail addressto - Recipient EMail addresssubject - Subject of messagemessage - The messagehtml -
public EMail(Properties ctx,
String smtpHost,
String from,
String to,
String subject,
String message)
ctx - contextsmtpHost - The mail serverfrom - Sender's EMail addressto - Recipient EMail addresssubject - Subject of messagemessage - The message
public EMail(Properties ctx,
String smtpHost,
String from,
String to,
String subject,
String message,
boolean html)
ctx - contextsmtpHost - The mail serverfrom - Sender's EMail addressto - Recipient EMail addresssubject - Subject of messagemessage - The messagehtml - html email| Method Detail |
|---|
public String send()
public String getSentMsg()
public boolean isSentOK()
protected MimeMessage getMimeMessage()
public String getMessageID()
public EMailAuthenticator createAuthenticator(String username,
String password)
username - user namepassword - user password
public InternetAddress getFrom()
public void setFrom(String newFrom)
newFrom - Sender's email addresspublic boolean addTo(String newTo)
newTo - Recipient's email address
public InternetAddress getTo()
public InternetAddress[] getTos()
public boolean addCc(String newCc)
newCc - EMail cc Recipient
public InternetAddress[] getCcs()
public boolean addBcc(String newBcc)
newBcc - EMail cc Recipient
public InternetAddress[] getBccs()
public boolean setReplyTo(String newTo)
newTo - email address
public InternetAddress getReplyTo()
public void setSubject(String newSubject)
newSubject - Subjectpublic String getSubject()
public void setMessageText(String newMessage)
newMessage - messagepublic String getMessageCRLF()
public void setMessageHTML(String html)
html - message
public void setMessageHTML(String subject,
String message)
subject - subject repeated in message as H2message - messagepublic String getMessageHTML()
public void addAttachment(File file)
file - file to attachpublic void addAttachments(Collection<File> files)
files - collection of filespublic void addAttachment(URL url)
url - url content to attach
public void addAttachment(byte[] data,
String type,
String name)
data - datatype - MIME typename - name of attachmentpublic void addAttachment(DataSource dataSource)
dataSource - content to attachpublic void setSmtpHost(String newSmtpHost)
newSmtpHost - Mail serverpublic String getSmtpHost()
public boolean isValid()
public boolean isValid(boolean recheck)
recheck - if true check main variables
public String toString()
toString in class Objectpublic static void main(String[] args)
args - Array of arguments
|
Adempiere 3.5.2a | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||