Hi,

I've been trying to use the HtmlEmail class, but it seems that I'm too dummy
to figure how to use it...
First, I try to build a HtmlEmail with:

================
                HtmlEmail html_email = new HtmlEmail();
                html_email.setHtmlMsg("<html><body>hi world</body></html>")
                    .addTo("[EMAIL PROTECTED]", "Joaquin Cuenca Abela")
                    .setFrom("[EMAIL PROTECTED]", "Joaquin Cuenca Abela")
                    .setSentDate(new Date())
                    .setSubject("Some stuff...")
                    .send();
================

If a try that, it dies with:

================
javax.mail.SendFailedException: Sending failed;
  nested exception is:
        javax.mail.MessagingException: IOException while sending message;
  nested exception is:
        java.io.IOException: No content
        at javax.mail.Transport.send0(Transport.java:218)
        at javax.mail.Transport.send(Transport.java:80)
        at org.apache.turbine.util.mail.Email.send(Email.java:394)
        at EmailInvoiceFournisseur.start(EmailInvoiceFournisseur.java:180)
        ...
================

ok, I was thinking that setHtmlMsg will set some content, but it seems that
I'm wrong, so I try:

================
                HtmlEmail html_email = new HtmlEmail();
                html_email.setMsg("<html><body><h1>Hello World!!</h1></body></html>")
                    .addTo("[EMAIL PROTECTED]", "Joaquin Cuenca Abela")
                    .setFrom("[EMAIL PROTECTED]", "Joaquin Cuenca Abela")
                    .setSentDate(new Date())
                    .setSubject("Some stuff...")
                    .send();
================

now, it gets better, I receive an email with "Hello World!!", but when I see
the source, it shows:

================
<html><body><pre><html><body><h1>Hello
World!!</h1></body></html></pre></body></html>
================

???

Who has appended "<html><body><pre>" and "</pre></body></html>"
Why setHtmlMsg doesn't set any content?

If it helps, I've using this class outside from turbine, so before creating
the HtmlEmail, I do:

=================
                TurbineResourceService trs = new TurbineResourceService();

trs.setPropertiesFileName("E:/dev/java/jakarta-tomcat-3.2/webapps/backoffice
/conf/TurbineResources.properties");
=================

Am I doing something wrong?

Cheers,

P.S.: I've searched in the archives, but I can not found anything related to
this problem.

--
Joaquin Cuenca Abela
[EMAIL PROTECTED]




------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to