Re: [PHP] Speed of sending email .. can I put them in a queue rather than wait?

2010-01-30 Thread Manuel Lemos
Hello,

on 01/27/2010 12:07 AM Eric Lee said the following:
 Hi, all
 
 I'am doubted about installing a local mail server for just low volume
 mailing.
 May I ask all yours professional what do you think about it ?

I do not use nor recommend Windows for delivering messages to many
recipients, but if you are stuck with it, maybe you can use Microsoft
Exchange in the same machine where PHP is running, you can drop the
messages in the mail queue pickup directory to avoid waiting for the
mail server to process them.

-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Speed of sending email .. can I put them in a queue rather than wait?

2010-01-30 Thread Per Jessen
Angus Mann wrote:

 The number of emails sent is very small. Each one is only sent after a
 user fills out a form and presses send.
 
 But there is a noticable lag of about 5 or sometimes 10 seconds after
 pressing send before the user sees the Mail sent page. I presume
 the reason for the lag is the time spent logging on and off a remote
 POP, then SMTP server, transferring the data etc.
 
 It would be better if this happened in the background - that is, the
 user could get on with doing his next task while the emails sat in a
 queue in the backgorund, being lined up and sent without PHP waiting
 for the process to finish.

sendmail is your answer. 


/Per

-- 
Per Jessen, Zürich (0.6°C)


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Speed of sending email .. can I put them in a queue rather than wait?

2010-01-26 Thread Eric Lee
On Tue, Jan 26, 2010 at 12:02 PM, Angus Mann angusm...@pobox.com wrote:

 Hi all.

 I'm currently using the phpmailer class from phpmailer.worxware.com to
 send datatbase -populated emails to clients.

 At the moment I'm runninng PHP on Windows and using the built-in sendmail
 equivalent packaged with XAMPP. It uses a remote SMTP that authenticates by
 prior logging into a POP account.

 The number of emails sent is very small. Each one is only sent after a user
 fills out a form and presses send.

 But there is a noticable lag of about 5 or sometimes 10 seconds after
 pressing send before the user sees the Mail sent page. I presume the
 reason for the lag is the time spent logging on and off a remote POP, then
 SMTP server, transferring the data etc.

 It would be better if this happened in the background - that is, the user
 could get on with doing his next task while the emails sat in a queue in the
 backgorund, being lined up and sent without PHP waiting for the process to
 finish.

 Can anybody recommend a good way of doing this? Is Mercury Mail going to
 help me here?


HI Angus,

+1 I agree on what Paul already said .
As in fact you were just to sent out low volume mails.
Create a table and queue all pending mails in that then use windows
scheduled tasks to perform the actual work
if that is not a real-time mail.


One thing to note, php on windows does't support specify username and
password.
But only hostname / IP Address and port only.


I can not help much
but just few more suggesions.

Hope these help

Eric,
Regards,


Re: [PHP] Speed of sending email .. can I put them in a queue rather than wait?

2010-01-26 Thread Manuel Lemos
Hello,

On Tue, Jan 26, 2010 at 12:02 PM, Angus Mann angusm...@pobox.com wrote:
 I'm currently using the phpmailer class from phpmailer.worxware.com to
 send datatbase -populated emails to clients.

 At the moment I'm runninng PHP on Windows and using the built-in sendmail
 equivalent packaged with XAMPP. It uses a remote SMTP that authenticates by
 prior logging into a POP account.

 The number of emails sent is very small. Each one is only sent after a user
 fills out a form and presses send.

 But there is a noticable lag of about 5 or sometimes 10 seconds after
 pressing send before the user sees the Mail sent page. I presume the
 reason for the lag is the time spent logging on and off a remote POP, then
 SMTP server, transferring the data etc.

 It would be better if this happened in the background - that is, the user
 could get on with doing his next task while the emails sat in a queue in the
 backgorund, being lined up and sent without PHP waiting for the process to
 finish.

 Can anybody recommend a good way of doing this? Is Mercury Mail going to
 help me here?

The problem is that you are using Windows. Windows is a weak platform
for what you are doing as it lacks of free solutions like those you find
in Linux or any other Unix like OS.

Under Linux practically every MTA has a queue. All MTAs queue messages
by default instead of sending the message right away, except for sendmail.

That is way faster than having your application to send messages to your
MTA by SMTP as you are doing.

If you are really stuck with Windows, if you can use Microsoft Exchange,
you may use a faster solution. Exchange has a local pickup queue
directory. You just write messages in that directory and leave them
there. PHP does not need to wait for any delivery. Exchange will pickup
the messages ASAP and deliver them.

This is explained in this presentation. Jump to slide 11.

http://www.phpclasses.org/browse/video/3/package/9.html

If you want to use this solution, the MIME message package has a driver
class for queueing messages in Exchange pickup queue directory . Take a
look at the test_pickup_message.php example script.


http://www.phpclasses.org/mimemessage


-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Speed of sending email .. can I put them in a queue rather than wait?

2010-01-26 Thread Jim Lucas
Manuel Lemos wrote:
 Hello,
 
 On Tue, Jan 26, 2010 at 12:02 PM, Angus Mann angusm...@pobox.com wrote:
 I'm currently using the phpmailer class from phpmailer.worxware.com to
 send datatbase -populated emails to clients.

 At the moment I'm runninng PHP on Windows and using the built-in sendmail
 equivalent packaged with XAMPP. It uses a remote SMTP that authenticates by
 prior logging into a POP account.

 The number of emails sent is very small. Each one is only sent after a user
 fills out a form and presses send.

 But there is a noticable lag of about 5 or sometimes 10 seconds after
 pressing send before the user sees the Mail sent page. I presume the
 reason for the lag is the time spent logging on and off a remote POP, then
 SMTP server, transferring the data etc.

 It would be better if this happened in the background - that is, the user
 could get on with doing his next task while the emails sat in a queue in the
 backgorund, being lined up and sent without PHP waiting for the process to
 finish.

 Can anybody recommend a good way of doing this? Is Mercury Mail going to
 help me here?
 
 The problem is that you are using Windows. Windows is a weak platform
 for what you are doing as it lacks of free solutions like those you find
 in Linux or any other Unix like OS.
 
 Under Linux practically every MTA has a queue. All MTAs queue messages
 by default instead of sending the message right away, except for sendmail.
 
 That is way faster than having your application to send messages to your
 MTA by SMTP as you are doing.
 

I agree that using a local MTA is somewhat faster then using a remote SMTP
server, but I would have to say that the performance issue that he is reporting
would be noticed by all that used remote SMTP servers if it were such a
significant difference.

I would argue that he needs to audit his code a little more.  What he said was
that the entire process from hitting the send button to showing the Mail sent
page took that long.  He said I presume the reason for the lag is the time
spent logging on and off a remote POP, then SMTP server, transferring the data
etc.  I would suggest that he find out if it is or not.  I would like to see
proof that it is this portion of the script that is causing the slowness before
 suggest he change his server platform.

He mentioned pulling data from a DB and generating the email dynamically.  Maybe
it is the DB that is causing some lag because of a badly structured SQL call.
Maybe it has to do with the size of the data that he is requesting from the DB.

Could it be the amount of data that he is submitting through the form?

I would suggest that he try and replicate the process with the simplest of code.
 Even as far as removing the DB portion and sending hard coded data instead of
stuff pulled from the db.

Simply enough, I would have many things that I would suggest trying before
telling someone to replace their OS.

Just my 2cents...

 If you are really stuck with Windows, if you can use Microsoft Exchange,
 you may use a faster solution. Exchange has a local pickup queue
 directory. You just write messages in that directory and leave them
 there. PHP does not need to wait for any delivery. Exchange will pickup
 the messages ASAP and deliver them.
 
 This is explained in this presentation. Jump to slide 11.
 
 http://www.phpclasses.org/browse/video/3/package/9.html
 
 If you want to use this solution, the MIME message package has a driver
 class for queueing messages in Exchange pickup queue directory . Take a
 look at the test_pickup_message.php example script.
 
 
 http://www.phpclasses.org/mimemessage
 
 


-- 
Jim Lucas
NOC Manager
541-323-9113
BendTel, Inc.
http://www.bendtel.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Speed of sending email .. can I put them in a queue rather than wait?

2010-01-26 Thread Eric Lee
Hi, all

I'am doubted about installing a local mail server for just low volume
mailing.
May I ask all yours professional what do you think about it ?


Thanks in advanced.



Regards,
Eric,




 --
 Jim Lucas
 NOC Manager
 541-323-9113
 BendTel, Inc.
 http://www.bendtel.com

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Speed of sending email .. can I put them in a queue rather than wait?

2010-01-26 Thread Paul M Foster
On Wed, Jan 27, 2010 at 10:07:13AM +0800, Eric Lee wrote:

 Hi, all
 
 I'am doubted about installing a local mail server for just low volume
 mailing.
 May I ask all yours professional what do you think about it ?
 

Every place I've ever hosted (all Linux servers) include a local MTA
which is up and running. In a large hosting operation, this local MTA
probably passes the mail for relay to a central MTA somewhere else in
the host's network. There are a variety of reasons for this. Among
others, it allows the hosting company to meter email and present a
single set of credentials to foreign (offsite) mail servers. And in
general, most hosting companies provide you with the location of the
local MTA, in case you need it for Perl, Python, cron or other scripts.
And PHP's mail() function will, by default, pass email to that local
MTA. And moreover, most (all?) Linux MTAs on boxes like this don't block
while they make connections. From the OP's description, it sounded like
his phpmailer() process was blocking while it made foreign connections.

Paul

-- 
Paul M. Foster

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Speed of sending email .. can I put them in a queue rather than wait?

2010-01-25 Thread Angus Mann
Hi all.

I'm currently using the phpmailer class from phpmailer.worxware.com to send 
datatbase -populated emails to clients.

At the moment I'm runninng PHP on Windows and using the built-in sendmail 
equivalent packaged with XAMPP. It uses a remote SMTP that authenticates by 
prior logging into a POP account.

The number of emails sent is very small. Each one is only sent after a user 
fills out a form and presses send.

But there is a noticable lag of about 5 or sometimes 10 seconds after pressing 
send before the user sees the Mail sent page. I presume the reason for the 
lag is the time spent logging on and off a remote POP, then SMTP server, 
transferring the data etc.

It would be better if this happened in the background - that is, the user could 
get on with doing his next task while the emails sat in a queue in the 
backgorund, being lined up and sent without PHP waiting for the process to 
finish.

Can anybody recommend a good way of doing this? Is Mercury Mail going to help 
me here?



Re: [PHP] Speed of sending email .. can I put them in a queue rather than wait?

2010-01-25 Thread Paul M Foster
On Tue, Jan 26, 2010 at 02:02:18PM +1000, Angus Mann wrote:

 Hi all.
 
 I'm currently using the phpmailer class from phpmailer.worxware.com to send 
 datatbase -populated emails to clients.
 
 At the moment I'm runninng PHP on Windows and using the built-in sendmail 
 equivalent packaged with XAMPP. It uses a remote SMTP that authenticates by 
 prior logging into a POP account.
 
 The number of emails sent is very small. Each one is only sent after a user 
 fills out a form and presses send.
 
 But there is a noticable lag of about 5 or sometimes 10 seconds after 
 pressing send before the user sees the Mail sent page. I presume the 
 reason for the lag is the time spent logging on and off a remote POP, then 
 SMTP server, transferring the data etc.
 
 It would be better if this happened in the background - that is, the user 
 could get on with doing his next task while the emails sat in a queue in the 
 backgorund, being lined up and sent without PHP waiting for the process to 
 finish.
 
 Can anybody recommend a good way of doing this? Is Mercury Mail going to help 
 me here?
 

If this were me, I'd set up a mailserver on the web machine and send
mail to it instead of using phpmailer to connect directly to a distant
mailserver. The authentication between phpmailer and the local
mailserver should be near instantaneous, and you can let the local
mailserver deal with transferring mails in its own sweet time. I don't
know if there's a mailserver included in XAMPP installations, but if so,
I'd do that. In fact, if you're just sending simple emails, you could
use PHP's built-in mail() function, which will connect directly to the
local mailserver without further configuration.

Paul

-- 
Paul M. Foster

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php