[opencms-dev] Problem with CmsHtmlMail

Claus Priisholm cpr at codedroids.com
Mon Nov 14 09:39:22 CET 2005


Are you sure that your smtp/user/password settings are correct? I think 
this was the error I got when my ISP changed settings and required 
username/password to be set during hook up to the SMTP server.

Phil.Launchbury at tssi.co.uk wrote:
> 
> Hi,
> 
> I am trying to use CmsHtmlMail on our website and it seems to be 
> building the email correctly. Code is as follows (stolen from elsewhere 
> in the best tradition of programming!) :
> 
> 
>         CmsHtmlMail amail = new CmsHtmlMail();
>         amail.setFrom("do-not-reply at tssi.co.uk", "Website");
>         amail.setSubject("Report");
> 
>         amail.addTo("phil.launchbury at tssi.co.uk");
> 
>         // Details for Authentication
> 
>         // amail.setAuthentication("something");
>        
>         String htmlcontent = 
> cms.getContent("../press/pdfs/retail-fight.pdf");
>         out.println(htmlcontent);
> 
>         amail.setHtmlMsg(htmlcontent);
> 
>         // Sending the Email
>         amail.send();
> 
> Sadly what I get back is:
> 
> java.lang.SecurityException: Access to default session denied
>                 at javax.mail.Session.getDefaultInstance(Session.java:292)
>                 at 
> org.apache.commons.mail.Email.getMailSession(Email.java:267)
>                 at org.apache.commons.mail.Email.send(Email.java:632)
>                 at 
> org.apache.commons.mail.MultiPartEmail.send(MultiPartEmail.java:126)
>                 at 
> org.apache.commons.mail.HtmlEmail.send(HtmlEmail.java:207)
>                 at 
> org.apache.jsp.report_0002drequest_jsp._jspService(report_0002drequest_jsp.java:186)
>                 at 
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92)
> 
> Any ideas? Other than "get someone in who understands Java" of course..
> 
> Cheers,
> Phil.
> 
> 
> ===================================
> Phil Launchbury                               IT Manager
> TSSI                           Tel:      +44 1793 747736
>        Email: phil.launchbury at tssi.co.uk
>                         TSSI Helpdesk
> Tel: +44 (0)8450 707898    Fax: +44 1793 747701  
> Email: support at tssi.co.uk    Web site: http://www.tssi.co.uk
> 
> 
> ________________________________________________________________________
> This e-mail has been scanned for all viruses by Star. The
> service is powered by MessageLabs. For more information on a proactive
> anti-virus service working around the clock, around the globe, visit:
> http://www.star.net.uk
> ________________________________________________________________________
> 
> 
> ------------------------------------------------------------------------
> 
> 
> 
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev

-- 
Claus Priisholm, CodeDroids ApS
Phone: +45 48 22 46 46
cpr (you know what) codedroids.com - http://www.codedroids.com
cpr (you know what) interlet.dk - http://www.interlet.dk
--
Javadocs and other OpenCms stuff: 
http://www.codedroids.com/community/opencms



More information about the opencms-dev mailing list