我正在使用PHPMailer。我必须发送两个附件,两者都是链接(一个是base64图像,第二个是url)。通过PHPMailer通过URL附件发送电子邮件
// Variables with images
$croped_img = 'data:image/jpg;base64,/extreme_long_code_here';
$photo_thumbnail_url = 'http://t2.ftcdn.net/jpg/00/76/44/75/400_F_76447580_gOWAV0P8APW0iC51OsW5huD6qoiEsh7O.jpg';
// PHPMailer
$mail->addAttachment('$photo_thumbnail_url', 'selected.jpg');
$mail->addAttachment('$croped_img', 'croped_img.jpg');
PHPMailer的工作原理是因为如果我以这种形式发送电子邮件,附件不会来。 但是,如果我链接本地图像,例如'images/abc.jpg'
然后他们来了。
我应该使用哪些php函数将变量作为电子邮件附件发送?
你应该使用方法AddEmbeddedImage – Komal 2015-02-23 12:06:53
但如何在我的情况下使用这个?我仍在尝试,但它不会为我工作。 – 2015-02-23 12:43:16
可能重复的[PHP的字符串附件](http://stackoverflow.com/questions/28129848/php-attachment-from-string) – Synchro 2015-02-23 13:46:28