I use this code
...

  // Create the attachment
  EmailAttachment attachment = new EmailAttachment();
attachment.setURL(new URL("http://www.apache.org/images/asf_logo_wide.gif "));
  attachment.setDisposition(EmailAttachment.ATTACHMENT);
  attachment.setDescription("Apache logo");
  attachment.setName("Apache logo");

  // Create the email message
  MultiPartEmail email = new MultiPartEmail();
  email.setHostName("mail.myserver.com");
  email.addTo("[email protected]", "John Doe");
  email.setFrom("[email protected]", "Me");
  email.setSubject("The logo");
  email.setMsg("Here is Apache's logo");

  // add the attachment
  email.attach(attachment);

  // send the email
  email.send();

so I think it is multipart email.
I just replace the URL.

Thank you


Le 20 janv. 10 à 16:50, Siegfried Goeschl a écrit :

Hi Sebastian,

are you using MultipartEmail or HtmlEmail?

Cheers,

Siegfried Goeschl


Sébastien Bonaimé wrote:
Hi !

I would like to use commons.mail to send with java with an attached
png image from an URL.

My problem is that the image in php generated and I think it creates a
problem.

I have the following error:
org.apache.commons.mail.EmailException: Invalid URL
set:http://myserver.mydomain.org/myphpscript.php?param1=122&param2=2009-01-01

20:10:52

I changed name of the server, script and parameters...

Do you think it is possible to do that ?

In my browser,
http://myserver.mydomain.org/myphpscript.php?param1=122&param2=2009-01-01 20:20:20

returns a correct png image.

I use the code that I found here:
http://commons.apache.org/email/userguide.html

Thank you

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to