<br><font size=2 face="sans-serif">Hi,</font>
<br>
<br><font size=2 face="sans-serif">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!) :</font>
<br>
<br>
<br><font size=2 face="sans-serif"> CmsHtmlMail
amail = new CmsHtmlMail();</font>
<br><font size=2 face="sans-serif"> amail.setFrom("do-not-reply
at tssi.co.uk", "Website");</font>
<br><font size=2 face="sans-serif"> amail.setSubject("Report");
</font>
<br>
<br><font size=2 face="sans-serif"> amail.addTo("phil.launchbury
at tssi.co.uk");</font>
<br>
<br><font size=2 face="sans-serif"> //
Details for Authentication</font>
<br>
<br><font size=2 face="sans-serif"> //
amail.setAuthentication("something");</font>
<br><font size=2 face="sans-serif"> </font>
<br><font size=2 face="sans-serif"> String
htmlcontent = cms.getContent("../press/pdfs/retail-fight.pdf");</font>
<br><font size=2 face="sans-serif"> out.println(htmlcontent);</font>
<br>
<br><font size=2 face="sans-serif"> amail.setHtmlMsg(htmlcontent);</font>
<br>
<br><font size=2 face="sans-serif"> //
Sending the Email</font>
<br><font size=2 face="sans-serif"> amail.send();</font>
<br>
<br><font size=2 face="sans-serif">Sadly what I get back is:</font>
<br>
<br><font size=3><tt>java.lang.SecurityException: Access to default session
denied<br>
at javax.mail.Session.getDefaultInstance(Session.java:292)<br>
at org.apache.commons.mail.Email.getMailSession(Email.java:267)<br>
at org.apache.commons.mail.Email.send(Email.java:632)<br>
at org.apache.commons.mail.MultiPartEmail.send(MultiPartEmail.java:126)<br>
at org.apache.commons.mail.HtmlEmail.send(HtmlEmail.java:207)<br>
at org.apache.jsp.report_0002drequest_jsp._jspService(report_0002drequest_jsp.java:186)<br>
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92)</tt></font>
<br>
<br><font size=2 face="sans-serif">Any ideas? Other than "get someone
in who understands Java" of course..</font>
<br>
<br><font size=2 face="sans-serif">Cheers,</font>
<br><font size=2 face="sans-serif">Phil.</font>
<br>
<br><font size=2 face="sans-serif"><br>
===================================<br>
Phil Launchbury
IT Manager<br>
TSSI
Tel: +44 1793 747736<br>
Email: phil.launchbury@tssi.co.uk<br>
TSSI Helpdesk<br>
Tel: +44 (0)8450 707898 Fax: +44 1793 747701 <br>
Email: support@tssi.co.uk Web site: http://www.tssi.co.uk<br>
<br>
</font>
<BR>
________________________________________________________________________<BR>
This e-mail has been scanned for all viruses by Star. The<BR>
service is powered by MessageLabs. For more information on a proactive<BR>
anti-virus service working around the clock, around the globe, visit:<BR>
http://www.star.net.uk<BR>
________________________________________________________________________<BR>