473,387 Members | 1,745 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,387 software developers and data experts.

Newsletter script in PHP

Hello,

I have programmed an application to manage newsletters in PHP. I send the
mails using smtp, but when there are more than 500 subscribers and when the
mails (in html) are too big, it is really slow.

What can I do gain speed ?

Thanks,

Nicolas
Jul 17 '05 #1
6 6354
"Nicolas" <ni*******@SPAMlomitko.com> wrote in message
news:bo***********@biggoron.nerim.net...
Hello,

I have programmed an application to manage newsletters in PHP. I send the
mails using smtp, but when there are more than 500 subscribers and when the mails (in html) are too big, it is really slow.

What can I do gain speed ?


Have you looked at using phpMailer? It's a very good mail handling class for
PHP that's completely free but has a lot of built-in functionality for
handling large quantities of mail. I've never used it for sending those
sorts of quantities of mail but there are plenty of other projects out there
using it so I'm sure the answer lies within somehow.
Jul 17 '05 #2
> Have you looked at using phpMailer? It's a very good mail handling class
for
PHP that's completely free but has a lot of built-in functionality for
handling large quantities of mail.


I'll try it, to see how fast it can be...

Thanks

Nicolas
Jul 17 '05 #3
Also, when you're using php's mail function or phpmailer, it is preferable
(from a speed perspective) to call the sent function once with a big to-list
rather than call the send function multiple times within a loop.

Doing the latter will open and close your connection to the mail server
slowing things down considerably.

Doing it once will mean that you lose the personalisation options (Dear
$Firstname $Lastname), but I guess this might be acceptable is your
preference is for speed.

Also, for phpmailer (which I also highly recommend), see the performance
questions in the FAQ here for more tips:
http://phpmailer.sourceforge.net/faq.html#faq4
"Nicolas" <ni*******@SPAMlomitko.com> wrote in message
news:bo***********@biggoron.nerim.net...
Have you looked at using phpMailer? It's a very good mail handling class for PHP that's completely free but has a lot of built-in functionality for
handling large quantities of mail.


I'll try it, to see how fast it can be...

Thanks

Nicolas

Jul 17 '05 #4
> Also, when you're using php's mail function or phpmailer, it is preferable
(from a speed perspective) to call the sent function once with a big to-list rather than call the send function multiple times within a loop.
I considered this solution (with bcc instead of to) but I need some
personalisation (see below).
Doing the latter will open and close your connection to the mail server
slowing things down considerably.

Doing it once will mean that you lose the personalisation options (Dear
$Firstname $Lastname), but I guess this might be acceptable is your
preference is for speed.
Actually, I don't need personalisations like dear $firstname $lastname, but
in my application, each subscriber gets an id and a key which allows him to
unsubscribe from the newsletter. And I need to send that key with the
newsletter in order to know that the user asking to unsubscribe is really
himself.

Otherwise he would send an unsubscribe request, receive a mail to confirm,
and then be unsubuscribed when the application received the confirmation,
which is a little heavy.
Also, for phpmailer (which I also highly recommend), see the performance
questions in the FAQ here for more tips:
http://phpmailer.sourceforge.net/faq.html#faq4


I'll have a look at that link

Thanks a lot

Nicolas
Jul 17 '05 #5
Hello,

On 11/13/2003 07:47 AM, Nicolas wrote:
I have programmed an application to manage newsletters in PHP. I send the
mails using smtp, but when there are more than 500 subscribers and when the
mails (in html) are too big, it is really slow.

What can I do gain speed ?


Sending mailings via SMTP is the slowest method of all because you need
to establish an TCP connection with a relay server which just injects
the messages in the queue to be resent again.

If you have a local mailer in your machine like
sendmail/qmail/postfix/etc... it is better to invoke the local mailer
program which is just what the mail() function does under Linux/Unix.

Depending on the type of local mailer that you use, you can try to
optimize the queue injection further for mass mailing, using the right
switches.

In that case you may want to try this class for composing and sending
messages that comes with sub-classes specialized in the delivery of
messages with different local mailers.

The class also makes it easy to compose messages in HTML properly
according to the RFC recommendations. If your message bodies do need to
be personalized for each user, the class can optimize the message
composing further.

http://www.phpclasses.org/mimemessage

--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

Jul 17 '05 #6
Hello,

On 11/13/2003 07:47 AM, Nicolas wrote:
I have programmed an application to manage newsletters in PHP. I send the
mails using smtp, but when there are more than 500 subscribers and when the
mails (in html) are too big, it is really slow.

What can I do gain speed ?


Sending mailings via SMTP is the slowest method of all because you need
to establish an TCP connection with a relay server which just injects
the messages in the queue to be resent again.

If you have a local mailer in your machine like
sendmail/qmail/postfix/etc... it is better to invoke the local mailer
program which is just what the mail() function does under Linux/Unix.

Depending on the type of local mailer that you use, you can try to
optimize the queue injection further for mass mailing, using the right
switches.

In that case you may want to try this class for composing and sending
messages that comes with sub-classes specialized in the delivery of
messages with different local mailers.

The class also makes it easy to compose messages in HTML properly
according to the RFC recommendations. If your message bodies do need to
be personalized for each user, the class can optimize the message
composing further.

http://www.phpclasses.org/mimemessage

--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Christopher-Robin | last post by:
Hi! I'm setting up a web-page for my boss, including a simple newsletter sent from a form-mask within an admin-area. I was wondering, weather I should code the script to send ONE email to all...
2
by: Nis Sarup | last post by:
A customer of mine wants to make a newsletter for their website. The newsletter should be HTML with images and sent to a database of her subscribers. They would like a script where they can easily...
0
by: cooldv | last post by:
i have an *access database + ASP newsletter* that is working fine and it sends newsletter to ALL the email addresses in the DB. i want to send this newsletter to only a select group (like people...
9
by: Mike Brearley | last post by:
I need to create a template for an online newsletter that will auto-generate page number (with current page not hyperlinked) and previous and next buttons (no previous on first page and no next on...
11
by: ginoplusio | last post by:
Hi, I'm developing a software to send newsletter to the users of my website. I have a problem on the stats, detecting the opening of the newsletter on the user's client. The method I've chosen...
0
by: slinky | last post by:
Thanks in advance for for any clues: I have a website I'm building using MS-Visual Web Developer Express (Asp.Net/VB.net). I'm tooling it to collect names and emails to send out our newsletter. I...
2
by: slinky | last post by:
Thanks in advance for for any clues: I have a website I'm building using MS-Visual Web Developer Express (Asp.Net/VB.net). I'm tooling it to collect names and emails to send out our newsletter. I...
1
by: slinky | last post by:
Thanks in advance for for any clues: I have a website I'm building using MS-Visual Web Developer Express Asp.Net/VB.net). I'm tooling it to collect names and emails to send out our newsletter. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...

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.