commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rinaldo" <rbona...@sardiniapoint.it>
Subject Help please!!!
Date Tue, 08 Aug 2006 17:10:08 GMT
I try to send an email with an attachment .

I use the example find in the userguide.

The mail arrive at destination but no attachment

Any suggestion ?

RInaldo

 

                  EmailAttachment attachment = new EmailAttachment();

                  //attachment.setPath("c:\\documenti\\aaa.pdf"); 

                  attachment.setURL(new
URL("http://www.sardiniapoint.it/images/home/ic.jpg"));

                  attachment.setDisposition(EmailAttachment.ATTACHMENT);

                  attachment.setDescription("Contratto Pdf");

                  attachment.setName("Contratto pDF");

 

//                Create the email message

                  MultiPartEmail email = new MultiPartEmail();

                  email.setHostName("somehost");

                  email.setAuthentication("user", "pwd");              

                  email.addTo("toAFriend");

                  email.setFrom("fromMe");

                  email.setContent("PROVA INVIO PDF", "text/html");

                  email.setSubject("PROVA INVIO CONTRATTO");

                  email.setMsg("Here is Apache's logo");

 

//                add the attachment

                  email.attach(attachment);

 

//                send the email

                  email.send();

 

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message