2017-04-21 51 views

回答

0

下面的代碼用於發送郵件帶附件

$email = new PHPMailer(); 
$email->From  = '[email protected]'; 
$email->FromName = 'Your Name'; 
$email->Subject = 'Message Subject'; 
$email->Body  = $bodytext; 
$email->AddAddress('[email protected]'); 

$file_to_attach = 'PATH_OF_YOUR_FILE_HERE'; 

$email->AddAttachment($file_to_attach , 'NameOfFile.pdf'); 

return $email->Send();