0

Hi

I used the script from this old thread:
http://www.daniweb.com/web-development/php/threads/60795/page3
on a vps I have running drupal on a lamp stack.

I'm fetching the email address to send to from my database and then loops through all fetched addresses and sends the mail.

It works brilliantly, but my problem is that it works a little too well, meaning that it sends the mail multiple times - somewhere between 5 and 10 times.

Anyone have an idea as to why it does this ?

Cheers :)

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by kevindougans
0

turn the error suppression off for a start:

for example:

$ok = @mail($email_to, $email_subject, $email_message, $headers);

to

$ok = mail($email_to, $email_subject, $email_message, $headers);

then comment this line out perhaps and instead put:

echo "mail($email_to, $email_subject, $email_message, $headers)";

from this you should be able to get more information to help figuring out why its sending multiple emails. I suspect it will be your database query pulling the same email addresses multiple times.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.