473,386 Members | 1,668 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

emails

zorgi
431 Expert 256MB
Hello guys

I have to send HTML email to over 1000 email addresses and I believe that at some point server will stop sending them even if my script works perfect on fewer email addresses. Basically I am looping through an array like this

[PHP]
$message = "some html";
$emails = array("email1@example.com", "email2@example.com",.... );
foreach($emails_array as $email){

$headers = 'MIME-Version: 1.0";
$headers .= 'Content-type: text/html; charset=iso-8859-1";
$headers .= 'To: $email' . "\r\n";
$headers .= 'From: Buldog Promo<name@example.com>' ";
mail($email, $subject, $message, $headers);
}
[/PHP]

My question is:
What is max number of elements array $emails should hold?
OR
Do you know way around this problem

Thank you for your Help
Oct 2 '08 #1
5 1044
Markus
6,050 Expert 4TB
Best thing you could do is contact your hosting provider and find out if they have a cap on how many emails you can send, say, per hour. PHP itself, as far as I know, doesn't limit the emails, but it will crash if you don't set the max execution time.

Cheers,
Markus.
Oct 2 '08 #2
Atli
5,058 Expert 4TB
Hi.

PHP doesn't limit it, but like Markus says, your host might.

You could also try sending to multiple email addresses at once.
See the manual for examples.

Or better yet, you could try one of the mailer classes, like PHPMailer. Usually works a lot better than the mail function. The manual even mentions that using the mail function with complex mails, like HTML mails, is not recommended.
Oct 2 '08 #3
Markus
6,050 Expert 4TB
Hi.

PHP doesn't limit it, but like Markus says, your host might.

You could also try sending to multiple email addresses at once.
See the manual for examples.

Or better yet, you could try one of the mailer classes, like PHPMailer. Usually works a lot better than the mail function. The manual even mentions that using the mail function with complex mails, like HTML mails, is not recommended.
You should be on PHPMailer's payroll, considering all the effort you put in to marketing them.

:P

Markus.
Oct 2 '08 #4
pbmods
5,821 Expert 4TB
Heya, Zorgi.

Is your script completing without any errors? Perhaps it times out after 1000 or so emails?
Oct 2 '08 #5
zorgi
431 Expert 256MB
Heya, Zorgi.

Is your script completing without any errors? Perhaps it times out after 1000 or so emails?
Thank you guys,

Script works great. All information I got here was very useful and needed. I would also recommend PHPMailer if you don't want your emails to end up in someones junk mail. Also... do contact your host and ask them how many emails you can send an hour.
Oct 10 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: simonc | last post by:
I've been programming in assembler and C/C++ for a number of years, but I'm only just starting down the road of PHP & MYSQL. I have a couple of questions: (1) Before I start writing my own...
1
by: dan glenn | last post by:
I'm creating HTML emails from a PHP site and sending them out to an email list (just about 40 people so far are on this list). I've tested and confirmed that these emails work in yahoo.com's...
0
by: Thomas Mandelid | last post by:
A client I`m working for want to be able to send multiple emails to customers of their own. I have developed a simple app to accomplish this, but the application has a few flaws and I`m looking for...
4
by: ItsMe | last post by:
Dear All, I'm getting junk email with around 140-150 kb almost everyday and it my mailbox is getting full and this emails are full of virus effected attachments. And I'm getting these emails...
5
by: Kun | last post by:
i have the following code: ---------------------------------- import smtplib from email.MIMEText import MIMEText fp = open('confirmation.txt', 'rb') msg = MIMEText(fp.read()) From =...
5
by: sck10 | last post by:
Hello, I am working on a new project where I need to: 1. open an email and then create an xml file from the email 2. open the xml file and parse the information. I would like to be able to do...
5
by: Jai | last post by:
Hi, I am in a problem of sending mass emails(newsletter) to my website members. Actually my problem is this: I want to send newsletter to my website members. But I had given a facility for...
2
by: =?Utf-8?B?RGFuY2Vy?= | last post by:
Hi, I was attempting to check my new incoming emails through Outlook Express (I have Windows 98, 2nd Edition). My computer seemed to be having a problem accessing and opening the emails, and the...
0
by: =?Utf-8?B?Q2hhcmxlcw==?= | last post by:
Like many people, I normally use Yahoo! Mail via the web and like to keep all my emails stored on the Yahoo! server. However sometimes I can’t get access to a PC/the web and I download my emails...
0
by: =?Utf-8?B?UmljaA==?= | last post by:
Hello, My company will be hosting a webcast, and I need to send out 2000 individual emails to people who signed up (for login information...). I created an smtp app that I can loop through...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.