Author: sgoeschl
Date: Tue Nov 2 00:40:28 2010
New Revision: 1029917
URL: http://svn.apache.org/viewvc?rev=1029917&view=rev
Log:
Updating the documentation
Modified:
commons/proper/email/trunk/src/site/xdoc/userguide.xml
Modified: commons/proper/email/trunk/src/site/xdoc/userguide.xml
URL:
http://svn.apache.org/viewvc/commons/proper/email/trunk/src/site/xdoc/userguide.xml?rev=1029917&r1=1029916&r2=1029917&view=diff
==============================================================================
--- commons/proper/email/trunk/src/site/xdoc/userguide.xml (original)
+++ commons/proper/email/trunk/src/site/xdoc/userguide.xml Tue Nov 2 00:40:28
2010
@@ -189,20 +189,20 @@ import org.apache.commons.mail.HtmlEmail
// load your HTML email template
String htmlEmailTemplate = ....
-
- // Create the email message
+
+ // define you base URL to resolve relative resource locations
+ URL url = new URL("http://www.apache.org");
+
+ // create the email message
HtmlEmail email = new ImageHtmlEmail();
+ email.setDataSourceResolver(new DataSourceResolverImpl(url));
email.setHostName("mail.myserver.com");
email.addTo("[email protected]", "John Doe");
email.setFrom("[email protected]", "Me");
email.setSubject("Test email with inline image");
- // embed the image and get the content id
- URL url = new URL("http://www.apache.org/images/asf_logo_wide.gif");
- String cid = email.embed(url, "Apache logo");
-
// set the html message
- email.setHtmlMsg(htmlEmailTemplate, new File("").toURI().toURL(), false);
+ email.setHtmlMsg(htmlEmailTemplate);
// set the alternative message
email.setTextMsg("Your email client does not support HTML messages");