Prabu Karana Prabu Karana - 3 months ago 34
PHP Question

Function set_magic_quotes_runtime() is deprecated in phpmailer

Help me, I want to embed an image with PHP Mailer version 5.1.. and my PHP version is 5.4.7

The script execution is a success, and I can receive emails with embedded images, but the problem is warnings appear like this:


Deprecated: Function set_magic_quotes_runtime() is deprecated in C:\xampp\htdocs\form\class.phpmailer.php on line 1480

Deprecated: Function set_magic_quotes_runtime() is deprecated in C:\xampp\htdocs\form\class.phpmailer.php on line 1484


and my script is is

$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' />.";

Answer

add these code into the top of your script

@set_magic_quotes_runtime(false);
ini_set('magic_quotes_runtime', 0);
Comments