|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.turbine.util.mail.MailMessage
Creates a very simple text/plain message and sends it.
MailMessage creates a very simple text/plain message and sends
it. It can be used like this:
MailMessage sm = new MailMessage("mail.domain.net",
"toYou@domain.net",
"fromMe@domain",
"this is the subject",
"this is the body");
Another example is:
MailMessage sm = new MailMessage();
sm.setHost("mail.domain.net");
sm.setHeaders("X-Mailer: Sendmail class, X-Priority: 1(Highest)");
sm.setFrom("Net Freak1 user1@domain.com");
sm.setReplyTo("Net Freak8 user8@domain.com");
sm.setTo("Net Freak2 user2@domain.com, Net Freak3 user3@domain.com");
sm.setCc("Net Freak4 user4@domain.com, Net Freak5 user5@domain.com");
sm.setBcc("Net Freak6 user6@domain.com, Net Freak7 user7@domain.com");
sm.setSubject("New Sendmail Test");
sm.setBody("Test message from Sendmail class, more features to be added.
Like multipart messages, html, binary files...");
sm.setDebug(true);
sm.send();
| Field Summary | |
protected javax.mail.internet.InternetAddress[] |
bcc
Deprecated. The email address or addresses that the email is being blind-carbon-copied to. |
protected java.lang.String |
body
Deprecated. The body of the email message. |
protected javax.mail.internet.InternetAddress[] |
cc
Deprecated. The email address or addresses that the email is being carbon-copied to. |
protected boolean |
debug
Deprecated. Displays debug information when true. |
protected javax.mail.internet.InternetAddress |
from
Deprecated. The email address that the mail is being sent from. |
protected java.util.Hashtable |
headers
Deprecated. Used to specify the mail headers. |
protected java.lang.String |
host
Deprecated. The host name of the mail server to use. |
protected javax.mail.internet.InternetAddress[] |
replyTo
Deprecated. The email address used for replies to this message. |
protected java.lang.String |
subject
Deprecated. The subject of the email message. |
protected javax.mail.internet.InternetAddress[] |
to
Deprecated. The email address or addresses that the email is being sent to. |
| Constructor Summary | |
MailMessage()
Deprecated. Default constructor. |
|
MailMessage(java.lang.String h,
java.lang.String t,
java.lang.String f,
java.lang.String s,
java.lang.String b)
Deprecated. Constructor used to specify host, to, from, subject, and body. |
|
MailMessage(java.lang.String h,
java.lang.String t,
java.lang.String c,
java.lang.String bc,
java.lang.String f,
java.lang.String s,
java.lang.String b,
boolean d)
Deprecated. Constructor used to specify host, to, cc, bcc, from, subject, body, and debug. |
|
| Method Summary | |
void |
addHeader(java.lang.String name,
java.lang.String value)
Deprecated. Adds a header (name, value) to the headers Hashtable. |
static javax.mail.internet.InternetAddress[] |
parseAddressField(java.lang.String str)
Deprecated. Parse an address field. |
static javax.mail.internet.InternetAddress[] |
parseAddressList(java.lang.String[] aList)
Deprecated. Parse an address list. |
static void |
parseHeader(java.lang.String str,
java.util.Hashtable headers)
Deprecated. Parse a header. |
static java.util.Hashtable |
parseHeaderField(java.lang.String str)
Deprecated. Parse a header field. |
static java.util.Hashtable |
parseHeaderList(java.lang.String[] hList)
Deprecated. Parse a header list. |
static javax.mail.internet.InternetAddress |
parseInternetAddress(java.lang.String str)
Deprecated. Parse an Internet address. |
static javax.mail.internet.InternetAddress |
parseInternetAddress(java.lang.String address,
java.lang.String personal)
Deprecated. Parse an Internet address. |
boolean |
send()
Deprecated. Send the message. |
void |
setBcc(javax.mail.internet.InternetAddress[] bc)
Deprecated. Used to specify the email address that the mail is being blind-carbon-copied to. |
void |
setBcc(java.lang.String bc)
Deprecated. Used to specify the email address that the mail is being blind-carbon-copied to. |
void |
setBody(java.lang.String b)
Deprecated. Used to specify the body of the email message. |
void |
setCc(javax.mail.internet.InternetAddress[] c)
Deprecated. Used to specify the email address that the mail is being sent to. |
void |
setCc(java.lang.String c)
Deprecated. Used to specify the email address that the mail is being carbon-copied to. |
void |
setDebug(boolean d)
Deprecated. Setting to true will enable the display of debug information. |
void |
setDebug(java.lang.String str)
Deprecated. Setting to true will enable the display of debug information. |
void |
setFrom(javax.mail.internet.InternetAddress f)
Deprecated. Used to specify the email address that the mail is being sent from. |
void |
setFrom(java.lang.String f)
Deprecated. Used to specify the email address that the mail is being sent from. |
void |
setHeaders(java.util.Hashtable h)
Deprecated. Used to specify the mail headers. |
void |
setHeaders(java.lang.String h)
Deprecated. Used to specify the mail headers. |
void |
setHost(java.lang.String h)
Deprecated. Used to specify the mail server host. |
void |
setReplyTo(javax.mail.internet.InternetAddress[] rt)
Deprecated. Used to specify the email address that the mail is being sent from. |
void |
setReplyTo(java.lang.String rp)
Deprecated. Used to specify the email address that the mail is being sent from. |
void |
setSubject(java.lang.String s)
Deprecated. Used to specify the subject of the email message. |
void |
setTo(javax.mail.internet.InternetAddress[] t)
Deprecated. Used to specify the email address that the mail is being sent to. |
void |
setTo(java.lang.String t)
Deprecated. Used to specify the email address that the mail is being sent to. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.lang.String host
protected java.util.Hashtable headers
protected javax.mail.internet.InternetAddress from
protected javax.mail.internet.InternetAddress[] replyTo
protected javax.mail.internet.InternetAddress[] to
protected javax.mail.internet.InternetAddress[] cc
protected javax.mail.internet.InternetAddress[] bcc
protected java.lang.String subject
protected java.lang.String body
protected boolean debug
| Constructor Detail |
public MailMessage()
public MailMessage(java.lang.String h,
java.lang.String t,
java.lang.String f,
java.lang.String s,
java.lang.String b)
h - A String with the host.t - A String with the TO.f - A String with the FROM.s - A String with the SUBJECT.b - A String with the BODY.
public MailMessage(java.lang.String h,
java.lang.String t,
java.lang.String c,
java.lang.String bc,
java.lang.String f,
java.lang.String s,
java.lang.String b,
boolean d)
h - A String with the host.t - A String with the TO.c - A String with the CC.bc - A String with the BCC.f - A String with the FROM.s - A String with the SUBJECT.b - A String with the BODY.d - True if debugging is wanted.| Method Detail |
public void addHeader(java.lang.String name,
java.lang.String value)
name - A String with the name.value - A String with the value.public static javax.mail.internet.InternetAddress[] parseAddressField(java.lang.String str)
str - A String with the address.
public static javax.mail.internet.InternetAddress[] parseAddressList(java.lang.String[] aList)
aList - A String[] with the addresses.
public static void parseHeader(java.lang.String str,
java.util.Hashtable headers)
str - A String with the header.headers - A Hashtable with the current headers.public static java.util.Hashtable parseHeaderField(java.lang.String str)
str - A String with the header field.
public static java.util.Hashtable parseHeaderList(java.lang.String[] hList)
hList - A String[] with the headers.
public static javax.mail.internet.InternetAddress parseInternetAddress(java.lang.String str)
str - A String with the address.
public static javax.mail.internet.InternetAddress parseInternetAddress(java.lang.String address,
java.lang.String personal)
address - A String with the address.personal - A String.
public boolean send()
public void setBcc(javax.mail.internet.InternetAddress[] bc)
bc - An InternetAddress[].public void setBcc(java.lang.String bc)
bc - A String.public void setBody(java.lang.String b)
b - A String.public void setCc(javax.mail.internet.InternetAddress[] c)
c - An InternetAddress[].public void setCc(java.lang.String c)
c - A String.public void setDebug(java.lang.String str)
str - A String.public void setDebug(boolean d)
d - A boolean.public void setFrom(java.lang.String f)
f - A String.public void setFrom(javax.mail.internet.InternetAddress f)
f - An InternetAddress.public void setHeaders(java.lang.String h)
h - A String.public void setHeaders(java.util.Hashtable h)
h - A Hashtable.public void setHost(java.lang.String h)
h - A String.public void setReplyTo(javax.mail.internet.InternetAddress[] rt)
rt - An InternetAddress[].public void setReplyTo(java.lang.String rp)
rp - A String.public void setSubject(java.lang.String s)
s - A String.public void setTo(javax.mail.internet.InternetAddress[] t)
t - An InternetAddress[].public void setTo(java.lang.String t)
t - A String.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||