Java Doc for SMTP.java in  » J2EE » Sofia » com » salmonllc » email » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » Sofia » com.salmonllc.email 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.salmonllc.email.SMTP

SMTP
public class SMTP implements Runnable(Code)
This class abstracts and simplifies the process of sending email to via an SMTP server


Field Summary
public  java.util.Properties_fieldSMTPServers
    
public  Thread_interruptThread
    
public  javax.mail.Session_mailSession
    
final public static  intiBCC
    
final public static  intiCC
    
final public static  intiTO
    

Constructor Summary
public  SMTP(String sHost)
     This create an SMTP object using the Standard Port 25.
public  SMTP(String sHost, int iPort)
     This create an SMTP object using the Specified Port iPort.
public  SMTP(String sHost, int iPort, String smtpAuthUser, String smtpAuthPass)
     Claudio Pi (04-02-2003) This method creates an SMTP object using the specified host, port, authentication username and password.
public  SMTP(String sHost, String smtpAuthUser, String smtpAuthPass)
     Claudio Pi (04-02-2003) This method creates an SMTP object using the specified host, authentication username and password.
public  SMTP(Properties props)
     This create an SMTP object using the Informations from a Properties object.

Method Summary
public  voidaddFile(String sFile)
     This method attaches to the SMTP object for use in sending mail to.
public  voidaddRecipient(String sAddress)
     This method adds Recipients to the SMTP object for use in sending mail to.
public  voidaddRecipient(String sAddress, int iRecipientType)
     This method adds Recipients to the SMTP object for use in sending mail to.
public  voidaddRecipients(String sCommaSepRecipients)
     This method adds Recipients to the SMTP object for use in sending mail to.
public  voidaddRecipients(String sCommaSepRecipients, int iRecipientType)
     This method adds Recipients to the SMTP object for use in sending mail to.
public  java.util.PropertiesgetSMTPServers()
    
public static  voidmain(String args)
     This is a main program for testing the SMTP class.
public  voidrun()
     This Method does the Coummunication with the SMTP server and sends the mail.
public  voidsendMail()
     This Method starts the Thread which Communicates with the SMTP server.
public  voidsetAuthPassword(String sAuthPass)
     fmc 04/03/03.
public  voidsetAuthUser(String sAuthUser)
     fmc 04/03/03.
public  voidsetBody(String sBody)
     This method sets the body of the mail message.
public  voidsetBodyMimeType(String sMimeType)
    
public  voidsetCloseResponse(String sClose)
     Sets the Close Response of the SMTP protocol.
public  voidsetDataResponse(String sData)
     Sets the Data Response of the SMTP protocol.
public  voidsetEndDataString(String sEndDataString)
     This method sets the Ending Character String to inicate the end of the message body.
public  voidsetErrorResponse(String sError)
     Sets the Error Response of the SMTP protocol.
public  voidsetFromAddress(String sAddress)
     This method sets the EMail address of the person the message is from.
public  voidsetHost(String sHost)
     This sets the Hostname of the SMTP Server.
public  voidsetOkResponse(String sOk)
     Sets the OK Response of the SMTP protocol.
public  voidsetOpenResponse(String sOpen)
     Sets the Open Response of the SMTP protocol.
public  voidsetPort(int iPort)
     This sets the port number of the SMTP server.
public  voidsetSMTPServers(java.util.Properties newSMTPServers)
     Sets the Properties object containing the information about SMTP settings.
public  voidsetSenderHost(String sSenderHost)
     This method sets the Sender Host of the message.
public  voidsetSubject(String sSubject)
     Sets the Subject of the E-Mail.
public  voidsetTimeStampFormat(String sFormat)
     Sets the TimeStampFormat used in the e-mail.
public  booleanwaitForMailSendToComplete(int iSeconds)
     This method waits iSeconds number of seconds to check to see if mail was sent successfully or not.

Field Detail
_fieldSMTPServers
public java.util.Properties _fieldSMTPServers(Code)



_interruptThread
public Thread _interruptThread(Code)



_mailSession
public javax.mail.Session _mailSession(Code)



iBCC
final public static int iBCC(Code)



iCC
final public static int iCC(Code)



iTO
final public static int iTO(Code)




Constructor Detail
SMTP
public SMTP(String sHost)(Code)
This create an SMTP object using the Standard Port 25.
Parameters:
  sHost - The Hostname of the SMTP server.



SMTP
public SMTP(String sHost, int iPort)(Code)
This create an SMTP object using the Specified Port iPort.
Parameters:
  sHost - The Hostname of the SMTP server
Parameters:
  iPort - The Port Number the SMTP server listens on.



SMTP
public SMTP(String sHost, int iPort, String smtpAuthUser, String smtpAuthPass)(Code)
Claudio Pi (04-02-2003) This method creates an SMTP object using the specified host, port, authentication username and password.
Parameters:
  sHost - The Hostname of the SMTP server
Parameters:
  iPort - The Port Number the SMTP server listens on.
Parameters:
  smtpAuthUser - The username to use for authentication.
Parameters:
  smtpAuthPass - The password to use for authentication.



SMTP
public SMTP(String sHost, String smtpAuthUser, String smtpAuthPass)(Code)
Claudio Pi (04-02-2003) This method creates an SMTP object using the specified host, authentication username and password.
Parameters:
  sHost - The Hostname of the SMTP server
Parameters:
  smtpAuthUser - The username to use for authentication.
Parameters:
  smtpAuthPass - The password to use for authentication.



SMTP
public SMTP(Properties props)(Code)
This create an SMTP object using the Informations from a Properties object.
Parameters:
  props - java.util.Properties The Properties object to specify the SMTP settings.




Method Detail
addFile
public void addFile(String sFile) throws SMTPException(Code)
This method attaches to the SMTP object for use in sending mail to.
Parameters:
  sFile - A Full Specified Path to a File.



addRecipient
public void addRecipient(String sAddress) throws SMTPException(Code)
This method adds Recipients to the SMTP object for use in sending mail to.
Parameters:
  sAddress - A Valid Email of a Recipient.



addRecipient
public void addRecipient(String sAddress, int iRecipientType) throws SMTPException(Code)
This method adds Recipients to the SMTP object for use in sending mail to.
Parameters:
  sAddress - A Valid Email of a Recipient.



addRecipients
public void addRecipients(String sCommaSepRecipients) throws SMTPException(Code)
This method adds Recipients to the SMTP object for use in sending mail to.
Parameters:
  sCommaSepRecipients - A Comma Separated List of valid E-Mail Addresses of Recipients.



addRecipients
public void addRecipients(String sCommaSepRecipients, int iRecipientType) throws SMTPException(Code)
This method adds Recipients to the SMTP object for use in sending mail to.
Parameters:
  sCommaSepRecipients - A Comma Separated List of valid E-Mail Addresses of Recipients.
Parameters:
  iRecipientType - int - the type of recipient (TO, CC or BCC)



getSMTPServers
public java.util.Properties getSMTPServers()(Code)
Returns the Properties object containing the SMTP settings java.util.Properties A Properties object with the SMTP settings



main
public static void main(String args)(Code)
This is a main program for testing the SMTP class.
Parameters:
  args - java.lang.String[] Parameters for the SMTP test.



run
public void run()(Code)
This Method does the Coummunication with the SMTP server and sends the mail. This Method should not be called by the developer, but only from calling sendMail.



sendMail
public void sendMail() throws SMTPException(Code)
This Method starts the Thread which Communicates with the SMTP server. This is the Method to be called when sending mail.



setAuthPassword
public void setAuthPassword(String sAuthPass)(Code)
fmc 04/03/03. This sets the SMTP Auth Password of the SMTP Server.
Parameters:
  sAuthPass - The hostname of the SMTP server



setAuthUser
public void setAuthUser(String sAuthUser)(Code)
fmc 04/03/03. This sets the SMTP Auth User of the SMTP Server.
Parameters:
  sAuthUser - The hostname of the SMTP server



setBody
public void setBody(String sBody)(Code)
This method sets the body of the mail message.
Parameters:
  sBody - A String representing the body of the message.



setBodyMimeType
public void setBodyMimeType(String sMimeType)(Code)
Sets the mime type of the body content of the e-mail
Parameters:
  sMimeType - java.lang.String MimeType of the body of the e-mail.



setCloseResponse
public void setCloseResponse(String sClose)(Code)
Sets the Close Response of the SMTP protocol.
Parameters:
  sClose - java.lang.String The Close Response of the SMTP protocol



setDataResponse
public void setDataResponse(String sData)(Code)
Sets the Data Response of the SMTP protocol.
Parameters:
  sData - java.lang.String The Data Response of the SMTP protocol



setEndDataString
public void setEndDataString(String sEndDataString)(Code)
This method sets the Ending Character String to inicate the end of the message body.
Parameters:
  sEndDataString - This String Indicates the end of the Body of Message which the server is Expecting.



setErrorResponse
public void setErrorResponse(String sError)(Code)
Sets the Error Response of the SMTP protocol.
Parameters:
  sError - java.lang.String The Error Response of the SMTP protocol



setFromAddress
public void setFromAddress(String sAddress) throws SMTPException(Code)
This method sets the EMail address of the person the message is from.
Parameters:
  sAddress - A valid EMail Address.



setHost
public void setHost(String sHost)(Code)
This sets the Hostname of the SMTP Server.
Parameters:
  sHost - The hostname of the SMTP server



setOkResponse
public void setOkResponse(String sOk)(Code)
Sets the OK Response of the SMTP protocol.
Parameters:
  sOk - java.lang.String The OK Response of the SMTP protocol



setOpenResponse
public void setOpenResponse(String sOpen)(Code)
Sets the Open Response of the SMTP protocol.
Parameters:
  sOpen - java.lang.String The Open Response of the SMTP protocol



setPort
public void setPort(int iPort)(Code)
This sets the port number of the SMTP server.
Parameters:
  iPort - The port of the SMTP Server.



setSMTPServers
public void setSMTPServers(java.util.Properties newSMTPServers)(Code)
Sets the Properties object containing the information about SMTP settings.
Parameters:
  newSMTPServers - java.util.Properties Properties Object with the SMTP settings



setSenderHost
public void setSenderHost(String sSenderHost)(Code)
This method sets the Sender Host of the message.
Parameters:
  sSenderHost - A Hostname representing the sending machine.



setSubject
public void setSubject(String sSubject)(Code)
Sets the Subject of the E-Mail.
Parameters:
  sSubject - java.lang.String The subject of the e-mail



setTimeStampFormat
public void setTimeStampFormat(String sFormat)(Code)
Sets the TimeStampFormat used in the e-mail.
Parameters:
  sFormat - java.lang.String The format of the timestamp for the e-mail



waitForMailSendToComplete
public boolean waitForMailSendToComplete(int iSeconds) throws SMTPException(Code)
This method waits iSeconds number of seconds to check to see if mail was sent successfully or not. boolean Returns true if Successfully sent.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.