Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple attachments through phpmailer

Tags:

php

phpmailer

I am using php mailer class to send multiple attachment mails. Two error are coming my way:

First these two lines apear when email is sended, these errors are from class.phpmailer.php:

Deprecated: Function set_magic_quotes_runtime() is deprecated in /var/www/dev01/maiarn/class.phpmailer.php on line 1471

Deprecated: Function set_magic_quotes_runtime() is deprecated in /var/www/dev01/maiarn/class.phpmailer.php on line 1475 Message has been sent.

Second The email is sent with only one attachment, The second goes where:

$mail->AddAttachment("logo.jpg"); // attachment
$mail->AddAttachment("logo.jpg"); 

Any Help

like image 315
Hanya Idrees Avatar asked Feb 16 '12 16:02

Hanya Idrees


People also ask

How can I send multiple emails in PHPMailer?

You have to create a completely different PHPMailer object for the second email, or you could just use AddAddress to send the same email to multiple addresses. If you don't want the senders to see each other, use BCC.

Does PHPMailer have a limit?

PHPMailer does not set any limits, nor does the mail() function, it's only ISPs like GoDaddy that do. However, they do so by blocking access to normal SMTP ports, and/or redirecting SMTP connections to their own servers ( *.

How do I attach multiple files to an email?

Select all of the files that you wish to send via email and copy them to a new folder. Now, right click on the folder and then select Send to. Selecting this will give you multiple options, look for the one that says Compressed (zipped) folder. Select this option and it will convert your folder into a zipped file.


1 Answers

It looks like you are using PHPMailer for PHP4 when you are running PHP5. If you are indeed running PHP5, make sure you have the latest PHPMailer from http://code.google.com/a/apache-extras.org/p/phpmailer/downloads/list

As for the attachments, you are attaching the same file twice? PHPMailer is probably removing duplicates.

like image 62
472084 Avatar answered Sep 17 '22 18:09

472084