Question

I have a problem with PHPMailer. It seems that i have customers that do no receive the attachment in their outlook box. Below is the code i am using. I tested it at my private gmail where the attachment is visible.

Could it be because i am using a stringAttachment instead of a real file?

$mail = new SMail();
$mail->SetFrom('administratie@domain.nl', 'Domain b.v.');
$mail->AddAddress($invoice->SAddress()->email);
$mail->Subject = 'Factuur ' . $invoice->getReferenceNumber();
$mail->AddStringAttachment($this->getAction($invoice->invoiceId, null, 'S'), $invoice->getReferenceNumber() . '.pdf', 'base64', 'application/pdf');
$this->objTemplate->assign(array(
    'title'              => 'Uw factuur',
    'referenceNumber'    => $invoice->getReferenceNumber(),
));
$mail->MsgHTML($this->objTemplate->render('mail/invoice.tpl', false, true));
Was it helpful?

Solution

The problem was the fact that outlook blocked the inline image content on which also the attachment broke somehow.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top