Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Mass mailing using PHP SMTP


  • Please log in to reply

#1
sentaro

sentaro

    New Member

  • Member
  • Pip
  • 4 posts
Hi all,

I tried sending mass mailing using php programming with SMTP method. I tried so many times to send to 1000 plus of members. But it always stop in half way. Sometimes it stop at 600th, sometimes 400th, sometimes 1000th, etc.. stop randomly.

I'm sending the mail using $mail->AddBCC() method. Sending every batch (50 emails / batch).
I add 50 email addresses to BCC , then I send it out. I loop it until 1000 plus email addresses.

I put all the email addresses in array first. Then, when I want to send it, I'll read from the array of email address. This proves that there's nothing wrong with the connection to database, right ?

I just suspect there's something wrong with the php connection, because when sending mass mailing, the page kept loading, never stop again until I press the Stop button. Is there's any solution to it ? I've tried to change the code logic and some setting/configuration.

These are the latest setting in my server :
Then I've set the php.ini file :
max_execution_time = 15000
max_input_time = 60


In httpd.conf, I set :
MaxKeepAliveRequests 500
KeepAliveTimeout 30
MinSpareServers 1
MaxSpareServers 1
StartServers 1

My Php version is 4.3.11
My Apache version is Apache/1.3.27 (Unix) (Red-Hat/Linux) PHP/4.3.11
My MySQL version is MySQL 3.23.56
  • 0

Advertisements


#2
brendandonhue

brendandonhue

    Member

  • Member
  • PipPipPip
  • 180 posts
Its probably timing out. Can you run the script the from PHP CLI (command line) instead of a web page?
Also, your SMTP server might have a limit on outgoing mail if you're using a host or ISPs.
  • 0

#3
sentaro

sentaro

    New Member

  • Topic Starter
  • Member
  • Pip
  • 4 posts
About limit of outgoing mail:
I think there's no problem with the limitation, because sometimes I can send 400, sometimes 600, sometimes 800. It's just like the connection sometimes connected, and sometimes not. That's why some of the batches (50 emails/batch) weren't sent out.
Like you said, it's timed out problem. I tried to set in php.ini file, but seems like it wasn't successful. :tazz:

I don't know about CLI. :)
  • 0

#4
KiLleR Civilian

KiLleR Civilian

    Member

  • Member
  • PipPip
  • 18 posts
make sure you restart your server after you set the php.ini
  • 0

#5
sentaro

sentaro

    New Member

  • Topic Starter
  • Member
  • Pip
  • 4 posts
Yes, I did restart the server. But still couldn't work. :tazz:
Is there any other setting needed to change ?
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP