函数 set_magic_quotes_runtime() 在 phpmailer 中已弃用

Pra*_*ana 5 php function phpmailer

我想用 PHP Mailer 版本 5.1 嵌入图像..我的 PHP 版本是 5.4.7

脚本执行成功,我可以收到带有嵌入图像的电子邮件,但问题是警告出现如下:

已弃用:函数 set_magic_quotes_runtime() 在 C:\xampp\htdocs\form\class.phpmailer.php 第 1480 行已弃用

已弃用:函数 set_magic_quotes_runtime() 在 C:\xampp\htdocs\form\class.phpmailer.php 第 1484 行已弃用

我的脚本是

$mail->AddEmbeddedImage('filename', 'cid', 'name');
$mail->AddEmbeddedImage('sgu_logo.gif', 'my-pics', 'sgu_logo.gif');

$mail->Body     =  "Thank you for registering at SGU. For further processing please complete a registration fee before &nbsp; ". $e['testschedule']." <br> For future information please contact us at sgu.ac.id/support <br><br> 
<img src='cid:sgu_logo.gif' alt='my-pics' />.";
Run Code Online (Sandbox Code Playgroud)

小智 5

这是因为 magic_quotes_runtime 函数从 PHP 5.3 版本开始被弃用,但 5.1 版本的 PHPmailer 仍然使用它们。尝试升级到PHPmailer 5.2,问题应该可以解决,更多信息在这里:http://code.google.com/a/apache-extras.org/p/phpmailer/source/detail ?r=66


Som*_*atd -6

将这些代码添加到脚本的顶部

@set_magic_quotes_runtime(false);
ini_set('magic_quotes_runtime', 0);
Run Code Online (Sandbox Code Playgroud)