daisydoos
asked on
Sending PDF attachments using PHPMailer
Hi,
Am sending a PDF attachment using PHPMailer like this:
$mail->AddStringAttachment ("files/pd f/name.pdf ", "name.pdf");
The attachment is sent with the email, but when I try to open, or save it to my machine to open it, get a message saying "couldnt opne file because it's either not a supported file type or because the file has been damaged eg it was sent as an attachment and wasnt correctly encoded....
I tried adjust the method above like this:
$mail->AddStringAttachment ("files/pd f/name.pdf ", "name.pdf","base64", "application/pdf")
but this didnt work.
The original file (I am sending) does open ok.
Any thoughts greatly appreciated.
Daisy
Am sending a PDF attachment using PHPMailer like this:
$mail->AddStringAttachment
The attachment is sent with the email, but when I try to open, or save it to my machine to open it, get a message saying "couldnt opne file because it's either not a supported file type or because the file has been damaged eg it was sent as an attachment and wasnt correctly encoded....
I tried adjust the method above like this:
$mail->AddStringAttachment
but this didnt work.
The original file (I am sending) does open ok.
Any thoughts greatly appreciated.
Daisy
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
many thanks - worked a treat!
Cheers,
Daisy