Java Doc for EmailSender.java in  » Web-Framework » jWebApp » jwebtk » mail » 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 » Web Framework » jWebApp » jwebtk.mail 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   jwebtk.mail.EmailSender

EmailSender
public class EmailSender (Code)
Handles sending emails via any SMTP server. EmailSender can handle plain text and/or HTML messages, any number of: send tos, cc tos, bcc tos, reply tos, and any number of attachments.

Inner Class :class MyAuthenticator extends Authenticator
Inner Class :class BodyObject

Field Summary
 SMTPMessagemessage
    
 intport
    
 Vectorsend_tosend_ccsend_bccreply_tobody_objects
    
 Sessionsession
    
 Stringsmtp_hostuser_idpassword
    

Constructor Summary
public  EmailSender(String smtpHost)
     Create instance of EmailSender.
public  EmailSender(String smtpHost, String userId, String password)
     Create instance of EmailSender.
public  EmailSender(String smtpHost, int port, String userId, String password)
     Create instance of EmailSender.

Method Summary
public  voidaddAttachment(String name, String filename, String description, boolean inline)
     Add an attachment to the email.
public  voidaddAttachment(String name, File file, String description, boolean inline)
     Add an attachment to the email.
public  voidaddAttachment(String name, URL url, String description, boolean inline)
     Add an attachment to the email.
public  voidaddBCCTo(String address)
     Add a BCC to address to the email.
public  voidaddBCCTo(String address, String name)
     Add a BCC to address to the email.
public  voidaddCCTo(String address)
     Add a CC to address to the email.
public  voidaddCCTo(String address, String name)
     Add a CC to address to the email.
public  voidaddHtml(String htmlMessage)
     Add HTML to the email.
public  voidaddReplyTo(String address)
     Add a replay to address to the email.
public  voidaddReplyTo(String address, String name)
     Add a replay to address to the email.
public  voidaddSendTo(String address)
     Add a send to address to the email.
public  voidaddSendTo(String address, String name)
     Add a send to address to the email.
public  voidaddText(String textMessage)
     Add a text message to the email.
 MimeMultipartbuildMultiPartContent()
    
public  MessagegetJavaMailMessage()
     Return the actual JavaMail Message object.
public  SessiongetJavaMailSession()
     Return the actual JavaMail Session object.
public static  voidmain(String[] args)
    
public  voidsendEmail()
     Send the email.
public static  voidsendEmail(String host, InternetAddress addressFrom, InternetAddress addressTo, String subject, String message)
     Convenience method for sending simple emails.
public static  voidsendEmail(String host, String userId, String password, InternetAddress addressFrom, InternetAddress addressTo, String subject, String message)
     Convenience method for sending simple emails.
public static  voidsendEmail(InternetAddress addressFrom, InternetAddress addressTo, String subject, String message)
     Convenience method for sending simple emails.
public static  voidsendEmail(String host, String addressFrom, String fromName, String addressTo, String toName, String subject, String message)
     Convenience method for sending simple emails.
public static  voidsendEmail(String host, String userId, String password, String addressFrom, String fromName, String addressTo, String toName, String subject, String message)
     Convenience method for sending simple emails.
public static  voidsendEmail(String addressFrom, String fromName, String addressTo, String toName, String subject, String message)
     Convenience method for sending simple emails.
public  voidsetDebug(boolean debug)
     Turns debugging on or off.
public  voidsetSentFrom(String address)
     Set the from address for the email.
public  voidsetSentFrom(String address, String name)
     Set the from address for the email.
public  voidsetSubject(String subject)
     Set the subject of the email message.

Field Detail
message
SMTPMessage message(Code)



port
int port(Code)



send_tosend_ccsend_bccreply_tobody_objects
Vector send_tosend_ccsend_bccreply_tobody_objects(Code)



session
Session session(Code)



smtp_hostuser_idpassword
String smtp_hostuser_idpassword(Code)




Constructor Detail
EmailSender
public EmailSender(String smtpHost)(Code)
Create instance of EmailSender.
Parameters:
  smtpHost - the domain or IP address of the SMTP host



EmailSender
public EmailSender(String smtpHost, String userId, String password)(Code)
Create instance of EmailSender.
Parameters:
  smtpHost - the domain or IP address of the SMTP host
Parameters:
  userId - Authenticate with userId
Parameters:
  password - Authenticate with password



EmailSender
public EmailSender(String smtpHost, int port, String userId, String password)(Code)
Create instance of EmailSender.
Parameters:
  smtpHost - the domain or IP address of the SMTP host
Parameters:
  port - the port the SMTP host is running on
Parameters:
  userId - Authenticate with userId
Parameters:
  password - Authenticate with password




Method Detail
addAttachment
public void addAttachment(String name, String filename, String description, boolean inline)(Code)
Add an attachment to the email.
Parameters:
  name - attachments name (simple filename, example: file.txt)
Parameters:
  filename - the attachment file path
Parameters:
  description - a description for the attachment
Parameters:
  inline - is the attachment inline



addAttachment
public void addAttachment(String name, File file, String description, boolean inline)(Code)
Add an attachment to the email.
Parameters:
  name - attachments name (simple filename, example: file.txt)
Parameters:
  file - the attachment file path
Parameters:
  description - a description for the attachment
Parameters:
  inline - is the attachment inline



addAttachment
public void addAttachment(String name, URL url, String description, boolean inline)(Code)
Add an attachment to the email.
Parameters:
  name - attachments name (simple filename, example: file.txt)
Parameters:
  url - URL to the attachment
Parameters:
  description - a description for the attachment
Parameters:
  inline - is the attachment inline



addBCCTo
public void addBCCTo(String address) throws EmailSenderException(Code)
Add a BCC to address to the email.
Parameters:
  address - address to BCC the email to



addBCCTo
public void addBCCTo(String address, String name) throws EmailSenderException(Code)
Add a BCC to address to the email.
Parameters:
  address - address to BCC the email to
Parameters:
  name - associate address with name



addCCTo
public void addCCTo(String address) throws EmailSenderException(Code)
Add a CC to address to the email.
Parameters:
  address - address to CC the email to



addCCTo
public void addCCTo(String address, String name) throws EmailSenderException(Code)
Add a CC to address to the email.
Parameters:
  address - address to CC the email to
Parameters:
  name - associate address with name



addHtml
public void addHtml(String htmlMessage)(Code)
Add HTML to the email.
Parameters:
  htmlMessage - the HTML message



addReplyTo
public void addReplyTo(String address) throws EmailSenderException(Code)
Add a replay to address to the email.
Parameters:
  address - address to reply to



addReplyTo
public void addReplyTo(String address, String name) throws EmailSenderException(Code)
Add a replay to address to the email.
Parameters:
  address - address to reply to
Parameters:
  name - associate address with name



addSendTo
public void addSendTo(String address) throws EmailSenderException(Code)
Add a send to address to the email.
Parameters:
  address - address to send the email to



addSendTo
public void addSendTo(String address, String name) throws EmailSenderException(Code)
Add a send to address to the email.
Parameters:
  address - address to send the email to
Parameters:
  name - associate address with name



addText
public void addText(String textMessage)(Code)
Add a text message to the email.
Parameters:
  textMessage - the text message



buildMultiPartContent
MimeMultipart buildMultiPartContent() throws EmailSenderException(Code)



getJavaMailMessage
public Message getJavaMailMessage()(Code)
Return the actual JavaMail Message object.



getJavaMailSession
public Session getJavaMailSession()(Code)
Return the actual JavaMail Session object. session object



main
public static void main(String[] args)(Code)



sendEmail
public void sendEmail() throws EmailSenderException(Code)
Send the email.



sendEmail
public static void sendEmail(String host, InternetAddress addressFrom, InternetAddress addressTo, String subject, String message) throws EmailSenderException(Code)
Convenience method for sending simple emails.
Parameters:
  host - the email server host address
Parameters:
  addressFrom - the email address the email is being sent from
Parameters:
  addressTo - the email address the email is being sent to
Parameters:
  subject - the subject of the email
Parameters:
  message - the email message



sendEmail
public static void sendEmail(String host, String userId, String password, InternetAddress addressFrom, InternetAddress addressTo, String subject, String message) throws EmailSenderException(Code)
Convenience method for sending simple emails.
Parameters:
  host - the email server host address
Parameters:
  userId - the userid for the email host
Parameters:
  password - the password for the email host
Parameters:
  addressFrom - the email address the email is being sent from
Parameters:
  addressTo - the email address the email is being sent to
Parameters:
  subject - the subject of the email
Parameters:
  message - the email message



sendEmail
public static void sendEmail(InternetAddress addressFrom, InternetAddress addressTo, String subject, String message) throws EmailSenderException(Code)
Convenience method for sending simple emails.
Parameters:
  addressFrom - the email address the email is being sent from
Parameters:
  addressTo - the email address the email is being sent to
Parameters:
  subject - the subject of the email
Parameters:
  message - the email message



sendEmail
public static void sendEmail(String host, String addressFrom, String fromName, String addressTo, String toName, String subject, String message) throws EmailSenderException(Code)
Convenience method for sending simple emails.
Parameters:
  host - the email server host address
Parameters:
  addressFrom - the email address the email is being sent from
Parameters:
  fromName - the name of the email sender
Parameters:
  addressTo - the email address the email is being sent to
Parameters:
  toName - the name the email is being sent to
Parameters:
  subject - the subject of the email
Parameters:
  message - the email message



sendEmail
public static void sendEmail(String host, String userId, String password, String addressFrom, String fromName, String addressTo, String toName, String subject, String message) throws EmailSenderException(Code)
Convenience method for sending simple emails.
Parameters:
  host - the email server host address
Parameters:
  userId - the userid for the email host
Parameters:
  password - the password for the email host
Parameters:
  addressFrom - the email address the email is being sent from
Parameters:
  fromName - the name of the email sender
Parameters:
  addressTo - the email address the email is being sent to
Parameters:
  toName - the name the email is being sent to
Parameters:
  subject - the subject of the email
Parameters:
  message - the email message



sendEmail
public static void sendEmail(String addressFrom, String fromName, String addressTo, String toName, String subject, String message) throws EmailSenderException(Code)
Convenience method for sending simple emails.
Parameters:
  addressFrom - the email address the email is being sent from
Parameters:
  fromName - the name of the email sender
Parameters:
  addressTo - the email address the email is being sent to
Parameters:
  toName - the name the email is being sent to
Parameters:
  subject - the subject of the email
Parameters:
  message - the email message



setDebug
public void setDebug(boolean debug)(Code)
Turns debugging on or off.
Parameters:
  debug - true if debugging, false if not.



setSentFrom
public void setSentFrom(String address) throws EmailSenderException(Code)
Set the from address for the email.
Parameters:
  address - address from



setSentFrom
public void setSentFrom(String address, String name) throws EmailSenderException(Code)
Set the from address for the email.
Parameters:
  address - address from
Parameters:
  name - associate address with name



setSubject
public void setSubject(String subject) throws EmailSenderException(Code)
Set the subject of the email message.
Parameters:
  subject - the subject of the email



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.