Like Comment under your original post say
Use PHPMailer
<?php
require_once('../class.phpmailer.php');
$mail = new PHPMailer(); // defaults to using php "mail()"
$mail->AddReplyTo("[email protected]","First Last");
$mail->SetFrom('[email protected]', 'First Last');
$mail->AddReplyTo("[email protected]","First Last");
$address = "[email protected]";
$mail->AddAddress($address, "John Doe");
$mail->Subject = "Php send pdf test";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->MsgHTML($body);
$mail->AttachFromString (base64_encode(file_get_contents($urlToPdf))); // attachment
// in your case it would be http://mydomian.com/pdf001.php
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}
?>
I edited this code from online real quick and think that could work. with your tweaking for each variable.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…