|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.ezprotocols.ezsmtp.EzSMTP
EzSMTP component provides a simple interface for sending electronic mail messages. EzSMTP javabean supports simple and HTML messages, priority, user authentification, multiple file attachments and more!
import com.ezprotocols.ezsmtp.*;
// This example simply sends a text email
public class SendMail {
public static void main(String[] args) {
try{
EzSMTP smtp = new EzSMTP();
smtp.setTo("info@ezprotocols.com");
smtp.setFrom("info@ezprotocols.com");
smtp.setSubject("EzSMTP Simple Test");
smtp.setMailServer("relais.videotron.ca");
smtp.setBody("EzSMTP Simple Test Body.");
smtp.sendMail();
}catch(EzSMTPException ex){
System.out.println(ex.getMessage());
}
}
}
| Field Summary | |
static int |
PRIORITY_HIGH
|
static int |
PRIORITY_HIGHEST
|
static int |
PRIORITY_LOW
|
static int |
PRIORITY_LOWEST
|
static int |
PRIORITY_NORMAL
|
| Constructor Summary | |
EzSMTP()
|
|
| Method Summary | |
void |
addEzSMTPEventListener(EzSMTPEventListener client)
Registers to receive events (serverReply). |
void |
disconnect()
Disconnects from the SMTP Server. |
java.lang.String |
getAbout()
Gets information about EzSMTP. |
java.lang.String |
getAttachedFile()
Gets the name of the file(s) to attach with the mail. |
java.lang.String |
getBcc()
Gets the Bcc address. |
java.lang.String |
getBody()
Gets the body of the electronic mail. |
java.lang.String |
getCc()
Gets the Cc address. |
boolean |
getConnected()
Indicates if currently connected to the SMTP Server. |
java.lang.String |
getFrom()
Gets the mail address of the sender. |
java.lang.String |
getHelo()
Gets identity used when executing the SMTP HELO command. |
int |
getMailPort()
Gets the SMTP Server port number. |
java.lang.String |
getMailServer()
Gets the SMTP server address. |
java.lang.String |
getPassword()
Gets the user password used for authentication. |
int |
getPriority()
Gets the priority of the electronic mail. |
java.lang.String |
getSerialKey()
Gets the Serial Key used to activate the full version. |
java.lang.String |
getSubject()
Gets the mail subject. |
int |
getTimeout()
Gets the Timeout to open the connection with the SMTP Server. |
java.lang.String |
getTo()
Gets the recipient address(es). |
java.lang.String |
getUsername()
Gets the username used for authentication. |
java.lang.String |
getVersion()
Gets the version number of EzSMTP. |
boolean |
isAuthLogin()
Indicates if the SMTP Server needs authentication. |
boolean |
isHtmlContent()
True if the body of the mail contains HTML. |
boolean |
isMultipleSend()
Gets MultipleSend flag which determines whether to disconnect after the sendMail() method is called. |
void |
removeEzSMTPEventListener(EzSMTPEventListener client)
UnRegisters from receiving events. |
void |
sendMail()
Sends an electronic mail. |
void |
setAbout(java.lang.String s)
|
void |
setAttachedFile(java.lang.String f)
Sets the name of the file to attach with the mail. |
void |
setAuthLogin(boolean a)
Set to True if SMTP Server needs authentication. |
void |
setBcc(java.sql.ResultSet rs,
int fieldId)
Sets the Bcc address from a ResultSet. |
void |
setBcc(java.lang.String s)
Sets the Bcc address. |
void |
setBody(java.lang.String s)
Sets the body of the electronic mail. |
void |
setCc(java.sql.ResultSet rs,
int fieldId)
Sets the CC address from a ResultSet. |
void |
setCc(java.lang.String s)
Sets the CC address. |
void |
setFrom(java.lang.String s)
Sets the mail address of the sender. |
void |
setHelo(java.lang.String s)
Sets identity used when executing the SMTP HELO command. |
void |
setHtmlContent(boolean b)
Set to True if the mail body contains HTML. |
void |
setMailPort(int port)
Sets the SMTP Server port (Default is 25). |
void |
setMailServer(java.lang.String s)
Sets the address of the SMTP Server. |
void |
setMultipleSend(boolean b)
Sets MultipleSend flag which determines whether to disconnect after the sendMail() method called. |
void |
setPassword(java.lang.String p)
Sets the user password for authentication with the SMTP Server. |
void |
setPriority(int p)
Sets the priority of the electronic mail. |
void |
setSerialKey(java.lang.String k)
Sets the Serial Key to activate the full version. |
void |
setSubject(java.lang.String s)
Sets the mail subject. |
void |
setTimeout(int t)
Sets the Timeout to open the connection with the SMTP Server. |
void |
setTo(java.sql.ResultSet rs,
int fieldId)
Sets the recipient(s) address from a ResultSet. |
void |
setTo(java.lang.String rcptTo)
Sets the recipient(s) address. |
void |
setUsername(java.lang.String u)
Sets the username for authentication with the SMTP Server. |
void |
setVersion(java.lang.String s)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int PRIORITY_LOWEST
public static final int PRIORITY_LOW
public static final int PRIORITY_NORMAL
public static final int PRIORITY_HIGH
public static final int PRIORITY_HIGHEST
| Constructor Detail |
public EzSMTP()
| Method Detail |
public void disconnect()
throws EzSMTPException
public void sendMail()
throws EzSMTPException
public void addEzSMTPEventListener(EzSMTPEventListener client)
public void removeEzSMTPEventListener(EzSMTPEventListener client)
public void setTo(java.lang.String rcptTo)
public void setTo(java.sql.ResultSet rs,
int fieldId)
throws EzSMTPException
ResultSet - rs: ResultSet containing Recipient Address(es).int - fieldId: Id of the field from which to extract address.public void setAttachedFile(java.lang.String f)
public void setAuthLogin(boolean a)
public void setPriority(int p)
public void setMultipleSend(boolean b)
public void setCc(java.lang.String s)
public void setUsername(java.lang.String u)
public void setHtmlContent(boolean b)
public void setPassword(java.lang.String p)
public void setCc(java.sql.ResultSet rs,
int fieldId)
throws EzSMTPException
ResultSet - rs: ResultSet containing Recipient Address(es).int - fieldId: Id of the field from which to extract address.public void setBcc(java.lang.String s)
public void setBcc(java.sql.ResultSet rs,
int fieldId)
throws EzSMTPException
ResultSet - rs: ResultSet containing Recipient Address(es).public void setSubject(java.lang.String s)
public void setHelo(java.lang.String s)
public void setTimeout(int t)
public void setBody(java.lang.String s)
public void setMailPort(int port)
public void setFrom(java.lang.String s)
public void setMailServer(java.lang.String s)
public void setVersion(java.lang.String s)
public void setAbout(java.lang.String s)
public void setSerialKey(java.lang.String k)
public java.lang.String getTo()
public int getPriority()
public java.lang.String getAttachedFile()
public java.lang.String getCc()
public boolean isAuthLogin()
public boolean isMultipleSend()
public java.lang.String getUsername()
public java.lang.String getPassword()
public java.lang.String getBcc()
public boolean getConnected()
public java.lang.String getBody()
public java.lang.String getHelo()
public int getMailPort()
public java.lang.String getSubject()
public int getTimeout()
public java.lang.String getMailServer()
public java.lang.String getFrom()
public boolean isHtmlContent()
public java.lang.String getVersion()
public java.lang.String getAbout()
public java.lang.String getSerialKey()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||