Jon wrote:
>
> on 12/7/2000 12:37 PM, "Joaquin Cuenca Abela" <[EMAIL PROTECTED]> wrote:
>
> > Ok, that's an auto-reply...
> >
> > I've took a look at the source, and I figured out that the
> problem is that I
> > was using setHtmlMsg("...") but I was not using
> setTextMsg("...") too, and
> > it seems that if you only use setHtmlMsg, it will send nothing...
> >
> > Is it the desired behaviour, or is it considered a bug?
> >
> > Cheers,
> >
> > P.S.: it's always good to have to sources to take a look :)
>
> I'm not sure. could you please do some more testing and find out? I just
> added some javadoc to say that you should also probably call
> setTextMsg() as
> well.
Sorry for a so late reply, but I've been busy.
I've took a deeper look at this problem. Actually, (tested with java-mail
1.1 and 1.2) when you try to send an email with a void BodyPart, then "send"
method will die with a MessagingException (with a nested IOException: No
content). I have a simple (~70 lines) class that shows that behaviour.
And in the line 131 of HtmlEmail.java turbine adds a MimeBodyPart to the
HtmlEmail (the MimeBodyPart that will contain the alternative text message),
but it doesn't set any text to this MimeBodyPart.
So, if somebody wants to send a HtmlEmail, he must do:
new HtmlEmail().setHtmlMsg("<head><body><h1>HI!</h1></body></head>")
.setTextMsg("") // <----
.addTo("[EMAIL PROTECTED]")
.setFrom("[EMAIL PROTECTED]")
.setSentDate(new Date())
.setSubject("the subject")
.send();
This problem can be solved if we add a msgText.setText("") in the line 131
of HtmlEmail.java. If the programmer wants to add an alternative text he
can always call HtmlEmail.setTextMsg("foo"), and "foo" will override "".
What do you think?
Cheers,
--
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]