<br><font size=2 face="sans-serif">Yes.. (it's talking to an internal SMTP
server that does not require authentication)</font>
<br>
<br><font size=2 face="sans-serif">And for some strange reason changing
to use CmsMultiPartMail works fine (except I have to kludge the text -
I can't do an HTML mail using CmsMultiPartMail - although I suppose that
is no great loss!).</font>
<br>
<br><font size=2 face="sans-serif">Amended (and working!) code is as follows:</font>
<br>
<br><font size=2 face="sans-serif"> CmsMultiPartMail
amail = new CmsMultiPartMail();</font>
<br>
<br><font size=2 face="sans-serif"> amail.setFrom("do-not-reply@tssi.co.uk",
"TSSI Website");</font>
<br><font size=2 face="sans-serif"> amail.setSubject("TSSI
Report");</font>
<br><font size=2 face="sans-serif"> amail.addTo("phil.launchbury@tssi.co.uk");</font>
<br>
<br><font size=2 face="sans-serif"> String
msgstring = "Thank you for requesting the report\n\nPlease find attached
an Acrobat PDF file with the report that you requested.\n\n";</font>
<br><font size=2 face="sans-serif"> msgstring
+= "If your PC cannot open PDF files please visit Adobe at http://www.adobe.com
to download the Acrobat PDF reader\n\n";</font>
<br>
<br><font size=2 face="sans-serif"> amail.setMsg(msgstring);</font>
<br>
<br><font size=2 face="sans-serif"> URL
u = new URL("{elided PDF name}");</font>
<br><font size=2 face="sans-serif"> String
aname = "TSSI Report.pdf";</font>
<br><font size=2 face="sans-serif"> String
adesc = "TSSI Report";</font>
<br><font size=2 face="sans-serif"> String
adisp = "mixed";</font>
<br>
<br><font size=2 face="sans-serif"> amail.attach(u,
aname, adesc, adisp);</font>
<br>
<br><font size=2 face="sans-serif"> amail.send();</font>
<br>
<br><font size=2 face="sans-serif">Cheers,</font>
<br><font size=2 face="sans-serif">Phil.</font>
<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>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Claus Priisholm <cpr@codedroids.com></b>
</font>
<br><font size=1 face="sans-serif">Sent by: opencms-dev-bounces@opencms.org</font>
<p><font size=1 face="sans-serif">14/11/2005 08:39</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Please respond to<br>
The OpenCms mailing list <opencms-dev@opencms.org></font></div></table>
<br>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">The OpenCms mailing list <opencms-dev@opencms.org></font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">Re: [opencms-dev] Problem with CmsHtmlMail</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2><tt>Are you sure that your smtp/user/password settings
are correct? I think <br>
this was the error I got when my ISP changed settings and required <br>
username/password to be set during hook up to the SMTP server.<br>
<br>
Phil.Launchbury@tssi.co.uk wrote:<br>
> <br>
> Hi,<br>
> <br>
> I am trying to use CmsHtmlMail on our website and it seems to be <br>
> building the email correctly. Code is as follows (stolen from elsewhere
<br>
> in the best tradition of programming!) :<br>
> <br>
> <br>
> CmsHtmlMail amail = new CmsHtmlMail();<br>
> amail.setFrom("do-not-reply at tssi.co.uk",
"Website");<br>
> amail.setSubject("Report");<br>
> <br>
> amail.addTo("phil.launchbury at tssi.co.uk");<br>
> <br>
> // Details for Authentication<br>
> <br>
> // amail.setAuthentication("something");<br>
> <br>
> String htmlcontent = <br>
> cms.getContent("../press/pdfs/retail-fight.pdf");<br>
> out.println(htmlcontent);<br>
> <br>
> amail.setHtmlMsg(htmlcontent);<br>
> <br>
> // Sending the Email<br>
> amail.send();<br>
> <br>
> Sadly what I get back is:<br>
> <br>
> java.lang.SecurityException: Access to default session denied<br>
> at javax.mail.Session.getDefaultInstance(Session.java:292)<br>
> at <br>
> org.apache.commons.mail.Email.getMailSession(Email.java:267)<br>
> at org.apache.commons.mail.Email.send(Email.java:632)<br>
> at <br>
> org.apache.commons.mail.MultiPartEmail.send(MultiPartEmail.java:126)<br>
> at <br>
> org.apache.commons.mail.HtmlEmail.send(HtmlEmail.java:207)<br>
> at <br>
> org.apache.jsp.report_0002drequest_jsp._jspService(report_0002drequest_jsp.java:186)<br>
> at <br>
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92)<br>
> <br>
> Any ideas? Other than "get someone in who understands Java"
of course..<br>
> <br>
> Cheers,<br>
> Phil.<br>
> <br>
> <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>
> <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>
> <br>
> <br>
> ------------------------------------------------------------------------<br>
> <br>
> <br>
> <br>
> _______________________________________________<br>
> This mail is send to you from the opencms-dev mailing list<br>
> To change your list options, or to unsubscribe from the list, please
visit<br>
> http://mail.opencms.org/mailman/listinfo/opencms-dev<br>
<br>
-- <br>
Claus Priisholm, CodeDroids ApS<br>
Phone: +45 48 22 46 46<br>
cpr (you know what) codedroids.com - http://www.codedroids.com<br>
cpr (you know what) interlet.dk - http://www.interlet.dk<br>
--<br>
Javadocs and other OpenCms stuff: <br>
http://www.codedroids.com/community/opencms<br>
<br>
<br>
_______________________________________________<br>
This mail is send to you from the opencms-dev mailing list<br>
To change your list options, or to unsubscribe from the list, please visit<br>
http://mail.opencms.org/mailman/listinfo/opencms-dev<br>
<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>
</tt></font>
<br>
<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>