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();

 

 

Reply via email to