Upload PDF document via LoadDocument and email vis smtp


I’m trying to upload a url which points to a PDF document and then email that document as an attachment. I’m using LoadDocument to upload it and it seems to work (no errors) but when I attach it to an email, send it using smtp and try to open the attachment it says ‘could not open because it is either not a supported file type or because the file has been damaged’.

I use the same smtp service to attach pdf documents which have been uploaded using getFile but that’s when I have a file path and not a url and it works fine.

I am using the following settings in LoadDocument:
method = get
loadAs = bytes

I am using the following settings in smtp:
charset = ISO-8859-1
attachments.contenttype = application/pdf
attachments.encoding = base64

Any suggestions welcome.



create a java service which reads the pdf and then invoke the pub.cleint:smtp service and pass these bytes to the attchments/content.


Will application/PDF effect anything?

Thanks for your post. I’ve used another service called http in pub.client which works fine.

Ramesh - Sorry don’t know java otherwise I would have done your suggestion.

RMG - The application/pdf affects what type of file is attached to the email. For example if I use text/pdf it attaches a text file and not a pdf file.

Thanks anyway.


I understand how the content-type works but i was wondering if application/(PDF)to uppercase would help?please ignore if it doesnt make sense to change.
since same contenttype you might have used in http service.