commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sgoes...@apache.org
Subject svn commit: r1029917 - /commons/proper/email/trunk/src/site/xdoc/userguide.xml
Date Tue, 02 Nov 2010 00:40:28 GMT
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("jdoe@somewhere.org", "John Doe");
   email.setFrom("me@apache.org", "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");



Mime
View raw message