1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| require "../class.phpmailer.php";
$mail = new PHPmailer();
$mail->IsHTML(true);
$mail->From='ericm83@hotmail.fr';
$mail->AddAddress('ericm83@hotmail.fr');
$mail->AddReplyTo('no reply');
$mail->Subject='Test';
$mail->Body='<html><body><center><font size=8>Le fichier est attaché ci-dessus</font><br></body></html>';
$mail->AddStringAttachment($doc, 'doc.pdf', 'base64', 'application/pdf');
$mail->Send();
if(!$mail->Send()){
echo $mail->ErrorInfo;
}
else{
echo 'Mail envoyé avec succès';
}
$mail->SmtpClose();
unset($mail); |