Sending mass emails
Moderator: General Moderators
-
vnwebworld
- Forum Newbie
- Posts: 9
- Joined: Thu Mar 09, 2006 8:07 am
Sending mass emails
Hi all,
I am doing a project for a client, and he has many customers. What he wants is sending to an email list, up to 1 million emails.
I have tried to loop and sent emails but the browser gets timeout. Do you guys have any solution?
I need this quite urgent. Please help me!
Thanks and regards.
I am doing a project for a client, and he has many customers. What he wants is sending to an email list, up to 1 million emails.
I have tried to loop and sent emails but the browser gets timeout. Do you guys have any solution?
I need this quite urgent. Please help me!
Thanks and regards.
- jayshields
- DevNet Resident
- Posts: 1912
- Joined: Mon Aug 22, 2005 12:11 pm
- Location: Leeds/Manchester, England
-
vnwebworld
- Forum Newbie
- Posts: 9
- Joined: Thu Mar 09, 2006 8:07 am
Thanks for fast reply.
I have tried PHPMailer and I am not sure how it can send like 1 million emails. Do you have a sample code?
And one problem with PHPMailer is emails will go to bulk box like AOL or Hotmail. My current solution is relaying through GMail, and PHPMailer cannot support it. Any suggestions?
Thanks for viewing.
I have tried PHPMailer and I am not sure how it can send like 1 million emails. Do you have a sample code?
And one problem with PHPMailer is emails will go to bulk box like AOL or Hotmail. My current solution is relaying through GMail, and PHPMailer cannot support it. Any suggestions?
Thanks for viewing.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Whoaaa... don't try sending 1,000,000 emails in one go from one script unless you hate your SMTP server administrator or you've not had your weetabix this morningvnwebworld wrote:Thanks for fast reply.
I have tried PHPMailer and I am not sure how it can send like 1 million emails. Do you have a sample code?
And one problem with PHPMailer is emails will go to bulk box like AOL or Hotmail. My current solution is relaying through GMail, and PHPMailer cannot support it. Any suggestions?
Thanks for viewing.
Do them in batches of 100 or so every minute.... much easier.
-
vnwebworld
- Forum Newbie
- Posts: 9
- Joined: Thu Mar 09, 2006 8:07 am
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
these may be of interest
viewtopic.php?t=42237
viewtopic.php?t=36871
viewtopic.php?t=34254
viewtopic.php?t=32422
viewtopic.php?t=42237
viewtopic.php?t=36871
viewtopic.php?t=34254
viewtopic.php?t=32422
- jayshields
- DevNet Resident
- Posts: 1912
- Joined: Mon Aug 22, 2005 12:11 pm
- Location: Leeds/Manchester, England
just have PHP read the file with the emails in it, explode on line breaks so that they are in an array.
then do a foreach on it, put a counter in the loop and every time it hits a multiple of 100 have PHP sleep for 120 seconds.
it will probably take about half a day to do it all (someone divide a million by 100, times it by 120 and divide it by 60 please, so we know the minutes
), and i doubt your server admin would like you very much if your on a shared host.
then do a foreach on it, put a counter in the loop and every time it hits a multiple of 100 have PHP sleep for 120 seconds.
it will probably take about half a day to do it all (someone divide a million by 100, times it by 120 and divide it by 60 please, so we know the minutes
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
-
vnwebworld
- Forum Newbie
- Posts: 9
- Joined: Thu Mar 09, 2006 8:07 am
To Feyd: Thanks Feyd, I already take a look at these. I did search the forum before I post this topics.
To jayshields: actually I did not send out email using my hosting smtp. I use GMail to send out. But the time is so much
To d11wtq: Thanks man, I also think of this solution but the problem is 1 million email, and 1 minute I send out only 1 email, so I need 1 milliion minutes for 1 category
.
By the way, how many emails can I add to the BCC field ? I thought of a solution that using cron to send email, each time about 200 or more depending on how many I could add to BCC field.
Any suggestions ?
Thanks all for viewing and giving your suggestions.
To jayshields: actually I did not send out email using my hosting smtp. I use GMail to send out. But the time is so much
To d11wtq: Thanks man, I also think of this solution but the problem is 1 million email, and 1 minute I send out only 1 email, so I need 1 milliion minutes for 1 category
By the way, how many emails can I add to the BCC field ? I thought of a solution that using cron to send email, each time about 200 or more depending on how many I could add to BCC field.
Any suggestions ?
Thanks all for viewing and giving your suggestions.
-
vnwebworld
- Forum Newbie
- Posts: 9
- Joined: Thu Mar 09, 2006 8:07 am
Simple: They don't.vnwebworld wrote:And one more thing is like this forum, if administrator want to send announcements to members through emails, what does it do ?
There is a purpose for email - to communicate with someone. There is no practical reason for communicating with a *million* people except commercial use or spam.
If its commercial use, you shouldn't be relying on *gmail*, a free provider to send the emails. If its spam, we have no desire to help.
Worse, we've answered every part of your question. Use phpmailer, read the docs, and you can indeed send *massive* numbers of emails. You can even spread it across multiple smtp servers, speeding up the process. phpmailer also offers the ability to do email batching, yet further speeding it up.
PHPMailer can in fact send with gmail as the smtp server. The "it goes to bulk box" is because you are spoofing the smtp server (you aren't gmail!), and sending BULK EMAIL!
-
vnwebworld
- Forum Newbie
- Posts: 9
- Joined: Thu Mar 09, 2006 8:07 am
Thanks for your reply.Roja wrote:Simple: They don't.vnwebworld wrote:And one more thing is like this forum, if administrator want to send announcements to members through emails, what does it do ?
There is a purpose for email - to communicate with someone. There is no practical reason for communicating with a *million* people except commercial use or spam.
If its commercial use, you shouldn't be relying on *gmail*, a free provider to send the emails. If its spam, we have no desire to help.
Worse, we've answered every part of your question. Use phpmailer, read the docs, and you can indeed send *massive* numbers of emails. You can even spread it across multiple smtp servers, speeding up the process. phpmailer also offers the ability to do email batching, yet further speeding it up.
PHPMailer can in fact send with gmail as the smtp server. The "it goes to bulk box" is because you are spoofing the smtp server (you aren't gmail!), and sending BULK EMAIL!
My client and I not going to use this program to spam. The reason why I use Gmail because my client wants me to give him many options. The first option is he will buy a good hosting for sending email and second one is using free smtp server. I also give him notice about not relying on gmail. As a service provider, I just find all solutions and give to my client
I will try PHPMailer again, maybe I havent taken a look at it carefully.
Thanks again for your comments.
You can send 1 milion (or more) of e-mails with XPertMailer very easy. Use for this Bcc, send them a package of 1000 (or less) e-mails to prevent the blocking mode. If you want to send via a Relay SMTP server like Gmail (from trusted host), then i will show you a simple example 'howto':
Execute the script (for preventing timeout on browser) from command line like: php -f /path/script.php
Make sure you have OpenSSL module (extension) enable on your PHP configuration.
Notice: put the real 'From' e-mail address that is the Gmail user account.
Code: Select all
<?php
set_time_limit(0);
error_reporting(E_ALL);
// path to XPertMailer.php file
require_once 'XPertMailer.php';
$mail = new XPertMailer(SMTP_RELAY, 'smtp.gmail.com');
$mail->auth('username@gmail.com', 'password', AUTH_DETECT, SSL_TRUE, 465);
$mail->from('username@gmail.com', 'My Name');
// many e-mail addresses separated by comma and space ...
$header['Bcc'] = 'client1@host1.com, client2@host2.com, client3@host3.com';
$mail->headers($header);
$send = $mail->send('destination@hostname.com', 'subject', 'text/plain message');
echo $send ? "Done." : "Error.";
echo "\nServer response: ".$mail->response;
?>Make sure you have OpenSSL module (extension) enable on your PHP configuration.
Notice: put the real 'From' e-mail address that is the Gmail user account.