EzSMTP 1.0 is used to send electronic mail (E-Mail) using the SMTP protocol.
EzSMTP javabean™ supports simple and HTML messages, priority, user authentication,
multiple file attachments and more!
Price : $35.00


[Try it!] [Buy it!]
[Methods]
[View Javadoc] [Download Javadoc]
[Example]


Principal methods
Method Name Description
EzSMTP()
Creates a new instance of EzSMTP.
sendMail() Sends an electronic mail.
setTo(String rcptTo) Sets the recipient(s) address. For multiple recipients, separate them with a semicolon ';'.
setTo(ResultSet rs, int fieldId) Sets the recipient(s) address from a ResultSet.
ResultSet rs: ResultSet containing Recipient Address(es).
int fieldId: Id of the field from which to extract address.
setSubject(String s) Sets the mail subject.
setPriority(int p) Sets the priority of the electronic mail.
setAttachedFile(String f) Sets the name of the file to attach with the mail. For multiple files, separate them with a semicolon ';'.
setHtmlContent(boolean b) Set as True if the mail body contains html.
setBody(String s) Sets the body of the electronic mail.
setMailServer(String s) Sets the address of the SMTP server.
setMailPort(int port) Sets the SMTP server port (Default is 25).
setAuthLogin(boolean a) Set to True if SMTP Server needs authentification.
setMultipleSend(boolean b) Sets MultipleSend flag which determines whether to disconnect after the sendMail() method is called. Setting MultipleSend to True allows multiple emails to be sent during a single SMTP session by invoking the sendMail() method and requires the disconnect() method to be called manually to end the connection.
disconnect() Disconnects from the SMTP Server.
setSerialKey(String k) Sets the Serial Key to activate the full version.


  Example : SendMail.java

import com.ezjavabeans.ezsmtp.*;

/** This example simply sends a text email */
public class SendMail {

  public static void main(String[] args) {
    try{
      EzSMTP smtp = new EzSMTP();
      smtp.setTo("test@test.com");
      smtp.setFrom("info@ezprotocol.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());
    }
  }
}


JAVA and all JAVA-based marks are trade-marks or registered trade-marks
of Sun Microsystems, Inc. in the U. S. and other countries.