Java Doc for MailMessageSender.java in  » Content-Management-System » apache-lenya-2.0 » org » apache » cocoon » 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 » Content Management System » apache lenya 2.0 » org.apache.cocoon.mail 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.cocoon.mail.MailMessageSender

MailMessageSender
public class MailMessageSender extends AbstractLogEnabled implements MailSender,Configurable,Serviceable,Initializable,Component(Code)
A helper class used by the org.apache.cocoon.acting.Sendmail and the sendmail.xsl logicsheet for sending an email message.

Configuration

smtp-hostSMTP server to use sending mail.optStringlocalhost
smtp-userUser name for authenticationoptString
smtp-passwordPassword for authenticationoptString

since:
   2.1
author:
   Frank Ridderbusch
author:
   Christian Haul
version:
   $Id: MailMessageSender.java 588324 2007-10-25 19:54:27Z vgritsenko $



Constructor Summary
public  MailMessageSender()
    
public  MailMessageSender(String smtpHost)
     Creates a new instance of MailMessageSender.

Method Summary
public  voidaddAttachment(Object attachment)
     Add an attachement to the message to be send.
public  voidaddAttachment(Object attachment, String type, String name)
     Add an attachement to the message to be send.
public  voidaddAttachmentURL(String url)
     Add an attachement to the message to be send.
public  voidaddAttachmentURL(String url, String type, String name)
     Add an attachement to the message to be send.
public  voidconfigure(Configuration config)
    
public  ExceptiongetException()
     Accesses any Exception caught by MailMessageSender.sendIt(org.apache.cocoon.environment.SourceResolver) .
public  voidinitialize()
    
public  voidsend()
     Assemble the message from the defined fields and send it.
public  voidsend(org.apache.cocoon.environment.SourceResolver resolver)
     Assemble the message from the defined fields and send it.
public  booleansendIt()
     Invokes the MailMessageSender.send() method but catches any exception thrown.
public  booleansendIt(org.apache.cocoon.environment.SourceResolver resolver)
     Invokes the MailMessageSender.send(org.apache.cocoon.environment.SourceResolver) method but catches any exception thrown.
public  voidservice(ServiceManager manager)
    
public  voidsetBcc(String bcc)
     Sets the address(es), which should receive a black carbon copy of the message.
public  voidsetBody(String body)
     Sets the body text of the email message.
public  voidsetBody(Object body)
     Sets the body content of the email message.
public  voidsetBody(Object body, String type)
     Sets the body content of the email message.
public  voidsetBodyFromSrc(String src)
     Sets the body source URL of the email message.
public  voidsetBodyFromSrcMimeType(String srcMimeType)
     Sets the optional body source Mime Type of the email message.
public  voidsetBodyURL(String url)
     Sets the body content of the email message.
public  voidsetBodyURL(String url, String type)
     Sets the body content of the email message.
public  voidsetCc(String cc)
     Sets the address(es), which should receive a carbon copy of the message.
public  voidsetCharset(String charset)
     Sets the character set for encoding the message.
public  voidsetFrom(String from)
     Set the from address of the message.
public  voidsetReplyTo(String replyTo)
     Sets the reply-to address(es) for the message.
public  voidsetSmtpHost(String hostname)
    
public  voidsetSmtpHost(String hostname, String username, String password)
    
public  voidsetSubject(String subject)
     Sets the subject line of the message.
public  voidsetTo(String to)
     Sets the destination address(es) for the message.


Constructor Detail
MailMessageSender
public MailMessageSender()(Code)



MailMessageSender
public MailMessageSender(String smtpHost)(Code)
Creates a new instance of MailMessageSender. Keep constructor for backwards compatibility.
Parameters:
  smtpHost - The host name or ip-address of a host to acceptthe email for delivery.MailSender




Method Detail
addAttachment
public void addAttachment(Object attachment)(Code)
Add an attachement to the message to be send.

The attachment can be any of: org.apache.excalibur.source.Source , org.apache.cocoon.servlet.multipart.Part , java.io.InputStream , byte[], String , or a subclass.
Parameters:
  attachment - to be send with the message




addAttachment
public void addAttachment(Object attachment, String type, String name)(Code)
Add an attachement to the message to be send.

The attachment can be any of: org.apache.excalibur.source.Source , org.apache.cocoon.servlet.multipart.Part , java.io.InputStream , byte[], String , or a subclass.
Parameters:
  attachment - to be send with the message
Parameters:
  type - mime type (optional)
Parameters:
  name - attachment name (optional)




addAttachmentURL
public void addAttachmentURL(String url)(Code)
Add an attachement to the message to be send.
Parameters:
  url - URL to attach to the message
See Also:   org.apache.excalibur.source.Source



addAttachmentURL
public void addAttachmentURL(String url, String type, String name)(Code)
Add an attachement to the message to be send.
Parameters:
  url - URL to attach to the message
Parameters:
  type - mime type (optional)
Parameters:
  name - attachment name (optional)
See Also:   org.apache.excalibur.source.Source



configure
public void configure(Configuration config) throws ConfigurationException(Code)



getException
public Exception getException()(Code)
Accesses any Exception caught by MailMessageSender.sendIt(org.apache.cocoon.environment.SourceResolver) . AddressException or MessagingException



initialize
public void initialize()(Code)



send
public void send() throws AddressException, MessagingException(Code)
Assemble the message from the defined fields and send it.
throws:
  AddressException - when problems with email addresses are found
throws:
  MessagingException - when message could not be send.



send
public void send(org.apache.cocoon.environment.SourceResolver resolver) throws AddressException, MessagingException(Code)
Assemble the message from the defined fields and send it.
throws:
  AddressException - when problems with email addresses are found
throws:
  MessagingException - when message could not be send.MailMessageSender.send()



sendIt
public boolean sendIt()(Code)
Invokes the MailMessageSender.send() method but catches any exception thrown. This method is intended to be used from the sendmail logicsheet. true when successful



sendIt
public boolean sendIt(org.apache.cocoon.environment.SourceResolver resolver)(Code)
Invokes the MailMessageSender.send(org.apache.cocoon.environment.SourceResolver) method but catches any exception thrown. This method is intended to be used from the sendmail logicsheet. true when successfulMailMessageSender.sendIt()



service
public void service(ServiceManager manager)(Code)



setBcc
public void setBcc(String bcc)(Code)
Sets the address(es), which should receive a black carbon copy of the message. The address is in the format, that javax.mail.internet.InternetAddress.parse(String) can handle (one or more email addresses separated by a commas).
Parameters:
  bcc - the address(es), which should receive a black carbon copy.
See Also:   javax.mail.internet.InternetAddress.parse(String)



setBody
public void setBody(String body)(Code)
Sets the body text of the email message. If both a text body and a body read from a source are set, only the latter will be used.
Parameters:
  body - The body text of the email messageMailMessageSender.setBody(Object)



setBody
public void setBody(Object body)(Code)
Sets the body content of the email message.

The body can be any of: org.apache.excalibur.source.Source , org.apache.cocoon.servlet.multipart.Part , java.io.InputStream , byte[], String , or a subclass.
Parameters:
  body - The body text of the email message




setBody
public void setBody(Object body, String type)(Code)
Sets the body content of the email message.

The body can be any of: org.apache.excalibur.source.Source , org.apache.cocoon.servlet.multipart.Part , java.io.InputStream , byte[], String , or a subclass.
Parameters:
  body - The body text of the email message
Parameters:
  type - mime type (optional)




setBodyFromSrc
public void setBodyFromSrc(String src)(Code)
Sets the body source URL of the email message. If both a text body and a body read from a source are set, only the latter will be used.
Parameters:
  src - The body source URL of the email messageMailMessageSender.setBodyURL(String)



setBodyFromSrcMimeType
public void setBodyFromSrcMimeType(String srcMimeType)(Code)
Sets the optional body source Mime Type of the email message.
Parameters:
  srcMimeType - The optional body source Mime Type of the email messageMailMessageSender.setBodyURL(String,String)



setBodyURL
public void setBodyURL(String url)(Code)
Sets the body content of the email message.
Parameters:
  url - URL to use as message body
See Also:   org.apache.excalibur.source.Source



setBodyURL
public void setBodyURL(String url, String type)(Code)
Sets the body content of the email message.
Parameters:
  url - URL to use as message body
Parameters:
  type - mime type (optional)
See Also:   org.apache.excalibur.source.Source



setCc
public void setCc(String cc)(Code)
Sets the address(es), which should receive a carbon copy of the message. The address is in the format, that javax.mail.internet.InternetAddress.parse(String) can handle (one or more email addresses separated by a commas).
Parameters:
  cc - the address(es), which should receive a carbon copy.
See Also:   javax.mail.internet.InternetAddress.parse(String)



setCharset
public void setCharset(String charset)(Code)
Sets the character set for encoding the message. This has no effect, if any attachments are send in the message.
Parameters:
  charset - the character set to be used for enbcoding the message



setFrom
public void setFrom(String from)(Code)
Set the from address of the message.
Parameters:
  from - The address the message appears to be from.



setReplyTo
public void setReplyTo(String replyTo)(Code)
Sets the reply-to address(es) for the message. The address is in the format, that javax.mail.internet.InternetAddress.parse(String) can handle (one or more email addresses separated by a commas).
Parameters:
  replyTo - the address(es) that replies should be sent to
See Also:   javax.mail.internet.InternetAddress.parse(String)



setSmtpHost
public void setSmtpHost(String hostname)(Code)



setSmtpHost
public void setSmtpHost(String hostname, String username, String password)(Code)



setSubject
public void setSubject(String subject)(Code)
Sets the subject line of the message.
Parameters:
  subject - the subject line of the message



setTo
public void setTo(String to)(Code)
Sets the destination address(es) for the message. The address is in the format, that javax.mail.internet.InternetAddress.parse(String) can handle (one or more email addresses separated by a commas).
Parameters:
  to - the destination address(es)
See Also:   javax.mail.internet.InternetAddress.parse(String)



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