How to use web file as emailattachment

Hi, sending mail from a web client works now, thank to a lot of good guys here at the forum. thanks!!!

My next problem is using a web file as source for my attachment. I can download the pdf and then pick it up for email but is it possible to do it directly.

The PDF is made with dynaPDF from MBS. and normaly the outfile is downloaded using outfile.data = pdf.getbuffer

But using this same with emailattachment says it has to be a file and now web file.
using emailattachement.data = pdf.getBuffer just renders two pages of blank… but the page count is right… so how do I get my pdf into my mail attachement without downloading it first…

I would really like to go from MBSdynaPDF to mail.attachements.append pdf

Possible ?

Thanks to Christian for helping me out.

dim a as new EmailAttachment

a.Data = EncodeBase64(PDFData)
a.ContentEncoding = “base64”
a.MIMEType = “application/pdf”
a.Name = “report.pdf”

em.Attachments.Append a