Código PHP:
<?php
require("Mailer/class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->CharSet = "UTF-8";
$mail->Mailer = "smtp";
$host = "ssl://smtp.gmail.com";
$port = 465;
$mail->SMTPAuth = true;
$mail->Username = "[email protected]";
$mail->Password = "********";
$mail->From = "[email protected]";
$mail->FromName = "PDF adjuntos";
$mail->Timeout = 30;
$mail->AddAddress($email,$nombre);
$mail->AddReplyTo("[email protected]","Webmaster");
$mail->WordWrap = 60;
$mail->AddAttachment("./archivo1.pdf", "uno.pdf");
$mail->AddAttachment('./archivo2.pdf', "dos.pdf");
$mail->IsHTML(true);
$mail->Subject = "pdfs";
$mail->Body = iconv("UTF-8", "ISO-8859-1",$mail->$body);
//$mail->Body = $body;
if($mail->Send()){
echo 'ok adjuntos';
}else{
echo 'Fail';
echo $mail->ErrorInfo;
}
$to = '[email protected]';
$message = "<h1 style='color:black;'>Aqui van los dos adjuntos ";
$headers="MIME-Version: 1.0"."\r\n";
$headers.="Content-type:text/html;charset=UTF-8"."\r\n";
$headers.="From:$email\r\nReply-To:$email\r\nReturn-Path:$email\r\n";
mail($to,$subject,$message,$headers);
?>