I'm using PHPMailer to send customers receipt of their order in a pdf format. PDF creation works like a dream, but it just wont attach it to mail. I've tried to my gmail and my own servers email, but it wont send the attachment. Here's my code:
<?php
//Lähetä tilausvahvistus
require_once('mail/class.phpmailer.php');
$bodytext = '
Olemme vastaanottaneet tilauksenne '. $ordernumber .'.
Tilaamanne tuotteet löytyvät liitteestä.'
;
$email = new PHPMailer();
$email->From = 'no-reply@xxx.fi';
$email->FromName = 'no-reply@xxx.fi';
$email->Subject = 'Olemme vastaanottaneet tilauksenne ' . $ordernumber;
$email->Body = $bodytext;
$email->AddAddress('christian.nikkanen@gmail.com');
$email->AddAttachment('kuitit/kuitti777.pdf','kuitti777.pdf');
return $email->Send();
?>
I've tried relative path and direct path, but no, it wont send.