PHPMailer attachment, doing it without a physical file

后端 未结 3 1952
青春惊慌失措
青春惊慌失措 2020-11-30 13:41

So:

// Setup mail class, recipients and body
$mailer->AddAttachment(\'/home/mywebsite/public_html/file.zip\', \'file.zip\');
The AddAttachment function ha         


        
3条回答
  •  不知归路
    2020-11-30 14:04

    AddStringAttachment($string,$filename,$encoding,$type)
    

    eg

    $mail = new PHPMailer();
    $mail->AddStringAttachment($string,$filename,$encoding,$type);
    

    http://phpmailer.github.io/PHPMailer/classes/PHPMailer.PHPMailer.PHPMailer.html#method_addStringAttachment

提交回复
热议问题