commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From C.Grobmeier <grobme...@possessed.de>
Subject Re: [EMAIL] - Sending both text plain and html.
Date Tue, 19 Dec 2006 12:13:26 GMT

Hi,

> Yes apaches tutorial is great, but it think it could be a bit more
> deeper infos.

you mean UML or stuff like this? As far as i know is Commons Email is based on the Sun Email
classes so going deeper into commons means going deeper into the suns mail api.

> Do you know how to add many attachemnts using EmailAttachemnt class
> for one mail? I can see how to make for one attachment, but not
> multiple.

I think it is:

EmailAttachment attachment = new EmailAttachment();
attachment.setPath("mypictures/john.jpg");
...

EmailAttachment attachment2 = new EmailAttachment();
attachment2.setPath("mypictures/john.jpg");
...

// Create the email message
MultiPartEmail email = new MultiPartEmail();
email.attach(attachment);
email.attach(attachment2);

Cheers,
Chris

> 
> Regards, Mathias.
> 
> 2006/12/19, C. Grobmeier <grobmeier@possessed.de>:
>>
>> > Do you know any more sites other then apache that have tutorials for
>> > common-email?
>>
>> Well actually i don't know any other sites. I always thought the example
> section is quite complete :-)
>>
>> Cheers
>> Chris
>>
>> >
>> > /Mathias
>> >
>> > 2006/12/19, C. Grobmeier <grobmeier@possessed.de>:
>> >>
>> >> Hi,
>> >>
>> >> > Hi, if im not misstaken common-email can  send both a body part
> with a
>> >> > plain text and a body part of html in one mail. So the reciever
> either
>> >> > get the text or html depending on the recievers email client
> settings.
>> >> > Is this true?
>> >> > Then second question how to i impl that. Like this?
>> >>
>> >> You need HTML-Messages. Visit this:
>> >> http://jakarta.apache.org/commons/email/userguide.html
>> >> and search for "HTML formatted email". You will see the following:
>> >>
>> >> HtmlEmail email = new HtmlEmail();
>> >> // set the html message
>> >> email.setHtmlMsg("<html>The apache logo - <img
>> > src=\"cid:"+cid+"\"></html>");
>> >> // set the alternative message
>> >> email.setTextMsg("Your email client does not support HTML messages");
>> >>
>> >> That should do fine.
>> >> Cheers,
>> >> Chris
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>> >> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>> >>
>> >>
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>> > For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message