Connecting Tech Pros Worldwide Help | Site Map

Newsletter script in PHP

Nicolas
Guest
 
Posts: n/a
#1: Jul 17 '05
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


Paulus Magnus
Guest
 
Posts: n/a
#2: Jul 17 '05

re: Newsletter script in PHP


"Nicolas" <nicolasNO@SPAMlomitko.com> wrote in message
news:bovjvk$1tsv$1@biggoron.nerim.net...[color=blue]
> 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[/color]
the[color=blue]
> mails (in html) are too big, it is really slow.
>
> What can I do gain speed ?[/color]

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.


Nicolas
Guest
 
Posts: n/a
#3: Jul 17 '05

re: Newsletter script in PHP


> Have you looked at using phpMailer? It's a very good mail handling class
for[color=blue]
> PHP that's completely free but has a lot of built-in functionality for
> handling large quantities of mail.[/color]

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

Thanks

Nicolas


furry
Guest
 
Posts: n/a
#4: Jul 17 '05

re: Newsletter script in PHP


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" <nicolasNO@SPAMlomitko.com> wrote in message
news:bovn53$1vs8$1@biggoron.nerim.net...[color=blue]
> Have you looked at using phpMailer? It's a very good mail handling class[/color]
for[color=blue]
> PHP that's completely free but has a lot of built-in functionality for
> handling large quantities of mail.[/color]

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

Thanks

Nicolas



Nicolas
Guest
 
Posts: n/a
#5: Jul 17 '05

re: Newsletter script in PHP


> Also, when you're using php's mail function or phpmailer, it is preferable[color=blue]
> (from a speed perspective) to call the sent function once with a big[/color]
to-list[color=blue]
> rather than call the send function multiple times within a loop.[/color]

I considered this solution (with bcc instead of to) but I need some
personalisation (see below).


[color=blue]
> 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.[/color]

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.


[color=blue]
> 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[/color]

I'll have a look at that link

Thanks a lot

Nicolas


Manuel Lemos
Guest
 
Posts: n/a
#6: Jul 17 '05

re: Newsletter script in PHP


Hello,

On 11/13/2003 07:47 AM, Nicolas wrote:[color=blue]
> 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 ?[/color]

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/

Manuel Lemos
Guest
 
Posts: n/a
#7: Jul 17 '05

re: Newsletter script in PHP


Hello,

On 11/13/2003 07:47 AM, Nicolas wrote:[color=blue]
> 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 ?[/color]

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/

Closed Thread