|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbiz.wisesoft.util.mail.EmailMessage
This class represents an email message.
To send an email you only need create one instance onf this class and call the "sendMail()" mehtod.
Example:
EmailMessage em=new EmailMessage(); em.from="wisesoft@wisesoft.biz"; em.addRecipient("user@wisesoft.biz"); //debug em.debug=true; //-------SMTP Authentication----- em.authUser="jim"; em.authPwd="12345678"; em.autMethod=m.AUTH_LOGIN; //------------------------------- em.subject="test"; MsgPart part=new MsgPart(); part.setData("This is the text",MimeEncoder.QUOTED); part.addPart(part); em.addFile(new java.io.File("c:\\file.doc")); em.smtpServer="smtp.hotpop.com"; em.sendMail(); //This is a sample to send an email which contains two parts EmailMessage em=new EmailMessage(); em.from="user@abc.com"; em.addRecipient("user@ms.com"); em.subject="test"; MsgPart part=new MsgPart(); part.ContentType="Multipart"; part.ContentSubType="Alternative"; MsgPart textpart=new MsgPart(); textpart.setData("This is the text",MimeEncoder.QUOTED); part.addPart(textpart); MsgPart htmlpart=new MsgPart(); htmlpart.ContentType="Multipart"; htmlpart.ContentSubType="Alternative"; htmlpart.setData("This is the html text",MimeEncoder.QUOTED); part.addPart(htmlpart); em.addPart(part); em.smtpServer="smtp.hotpop.com"; em.sendMail();
Nested Class Summary | |
class |
EmailMessage.SMTP
|
Field Summary | |
int |
AUTH_LOGIN
|
int |
AUTH_NONE
|
int |
AUTH_PLAIN
|
java.lang.String |
authPwd
|
java.lang.String |
authUser
|
int |
autMethod
|
java.lang.String |
charSet
Characters to be used. |
java.lang.String |
ContentSubType
Content subtype of the e-mail. |
java.lang.String |
ContentType
Content type of the e-mail |
boolean |
debug
|
java.lang.String |
FileName
|
java.lang.String |
from
Sender's email address. |
java.lang.String |
jMsg
Message as sent. |
biz.wisesoft.util.mail.JvInterface |
liste
listener of the message. |
java.lang.String |
mailHeader
Header of the message as sent. |
java.lang.String |
msgId
Id of the message |
java.lang.String |
nameFrom
|
java.lang.String[] |
otherFields
Additional header fields in rfc822 format that should be sent. |
int |
partCounter
number of parts in the message |
java.lang.String |
replyTo
Address of the replyto. |
java.lang.String |
smtpDate
Date field of the smtp message. |
java.lang.String |
smtpOwnAddress
Name or address of the computer sending the mail. |
int |
smtpPort
Smpt port to connect to. |
java.lang.String |
smtpServer
The SMTP Server used to send the e-mail. |
java.lang.String |
smtpStatus
Description of the current status of the connection. |
java.lang.String |
subject
Subject of the email. |
java.lang.String |
timeZoneStr
Time zone to be inserted in the date of the email. |
Constructor Summary | |
EmailMessage()
Creates a a new mail message. |
Method Summary | |
void |
addBCC(java.lang.String dest)
Adds a blind copy recipient. |
void |
addCC(java.lang.String dest)
Adds a carbon copy recipient. |
boolean |
addFile(java.io.File filepart)
Adds a new message part that will contain a file. |
void |
addPart(MsgPart p)
Add a new message part |
void |
addRecipient(java.lang.String dest)
Adds a message recipient. |
MsgPart |
getPart(int num)
|
static void |
MailMsg()
|
int |
sendMail()
Sends the message. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public java.lang.String from
public java.lang.String nameFrom
public java.lang.String subject
public java.lang.String smtpServer
public java.lang.String timeZoneStr
public java.lang.String replyTo
public java.lang.String msgId
public java.lang.String charSet
public java.lang.String ContentType
public java.lang.String ContentSubType
public java.lang.String[] otherFields
public java.lang.String smtpStatus
public java.lang.String smtpOwnAddress
public int smtpPort
public java.lang.String mailHeader
public java.lang.String jMsg
public biz.wisesoft.util.mail.JvInterface liste
public java.lang.String FileName
public java.lang.String smtpDate
public java.lang.String authUser
public java.lang.String authPwd
public final int AUTH_LOGIN
public final int AUTH_PLAIN
public final int AUTH_NONE
public int autMethod
public int partCounter
public boolean debug
Constructor Detail |
public EmailMessage()
Method Detail |
public static void MailMsg()
public MsgPart getPart(int num)
public boolean addFile(java.io.File filepart)
filepart
- a file
public void addPart(MsgPart p)
p
- The message partpublic void addRecipient(java.lang.String dest)
dest
- The message recipientpublic void addCC(java.lang.String dest)
dest
- The carbon copy recipientpublic void addBCC(java.lang.String dest)
dest
- The blind copy recipientpublic int sendMail()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |