I'm trying to send an email with a PDF attachment using the phpmailer class.
I used this code:
Within mailTo
function:
$mail->AddAttachment($pdffile);
where $pdffile = $_SERVER['DOCUMENT_ROOT'] . "/facturen/test.pdf"
Sending the mail results in an email without attachment but with:
--b1_3768f40f33d9a5dec555d03a15af14f9
Content-Type: text/html; charset = "iso-8859-1"
Content-Transfer-Encoding: 8bit
at the top of my email and on the bottom of my email:
--b1_3768f40f33d9a5dec555d03a15af14f9
Content-Type: application/octet-stream; name="test.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test.pdf"
JVBERi0xLjQKJcfsj6IKMTEgMCBvYmoKPDwvTGVuZ3RoIDEyIDAgUi9GaWx0ZXIgL0ZsYXRlRGVj
b2RlPj4Kc3RyZWFtCnic7VtZs9zEFa5A2CYpQyALSUiiNyQqI3pfeGOrOECgMJc8BPJg38Xbta8x
NqbyL/Jn85yvF6mPpNbMXMoPVCrlskvT6j59+izfWdT+pmG9UA0Lf4aH43ubt69x2dz8dsOb8Ofh
zY2zrGfeNU7yXmvf3Ns4wXrDxDhiHes50431vGdGlt8K741pjjfDiMEMbZuBgNHhp2qGLYbfxxvP
fa+9Gke8CTOG9flXoT8MZAaG1QOD8yMcb87e2sieCwXST3DUj/D3Tj7ytb/8bx751uaLzTcNV1r3
0kVtcy5Vr3ijmeqNwFzfc+51tgLVfHCx+XwT7SMIRbMgsUAZkzkPlFygBCq2V83D00jfOZAUJtE3
eHamwSoBJhvJlOidzfR1or97iXAWm/i8xBy0xHLZDytsfYXoPV2hNes9z0tcWgKxKq5NMA8RVJCn
QVzO6UjKaJxb6XTyJCa4yzcb1XNjjI
and so on...
How to resolve this?