Re: [PHP] Run Process in back ground

2008-02-13 Thread Richard Lynch
On Mon, February 11, 2008 1:23 pm, Richard Kurth wrote:
 Is there a way that I can call a function that will send an email and
 then move on redirecting to another website without having to what for
 the email to send?
 SendEmail($memberemail,$MailFrom,$MailHost);
 header(Location:http://domain.com;);

The email is not actually sent if you use a decent email program that
just queues it up...

So it really should not take any time at all for the SendEmail
function to run...

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Run Process in back ground

2008-02-12 Thread Nirmalya Lahiri
--- Richard Kurth [EMAIL PROTECTED] wrote:

 Is there a way that I can call a function that will send an email
 and 
 then move on redirecting to another website without having to what
 for 
 the email to send?
 SendEmail($memberemail,$MailFrom,$MailHost);
 header(Location:http://domain.com;);
 
 -- 

Richard,
 You can do it in other way. The steps are
1 Just keep the emails in database.
2 Write another shell/PHP script which will fetch email from
database and send the email using local/remote MTA.
3 Run this script from cron as background process.


---
Nirmalya Lahiri
[+91-9433113536]


  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 

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



Re: [PHP] Run Process in back ground

2008-02-11 Thread Per Jessen
Richard Kurth wrote:

 Is there a way that I can call a function that will send an email and
 then move on redirecting to another website without having to what for
 the email to send?
 SendEmail($memberemail,$MailFrom,$MailHost);
 header(Location:http://domain.com;);

Yes: 

mail(  );
header(Location:http://domain.com;);


mail() only takes as long as it takes to drop the mail in your local
filesystem.  


/Per Jessen, Zürich

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



Re: [PHP] Run Process in back ground

2008-02-11 Thread Stut

Per Jessen wrote:

Richard Kurth wrote:


Is there a way that I can call a function that will send an email and
then move on redirecting to another website without having to what for
the email to send?
SendEmail($memberemail,$MailFrom,$MailHost);
header(Location:http://domain.com;);


Yes: 


mail(  );
header(Location:http://domain.com;);


mail() only takes as long as it takes to drop the mail in your local
filesystem.  


Not necessarily. As discussed at length on this list last month sendmail 
(or a substitute) may try to deliver the message rather than passing it 
to a local MTA.


Richard: If sending the mail is taking a long time you need to look at 
exactly how you're sending it. As Per points out the fastest way to send 
email is to dump it to a local MTA. You should be able to configure your 
system to do that pretty easily, but if you don't have that kind of 
access either change hosts or look at poking the message into an 
outgoing queue you implement yourself (file or db-based with a cron job 
to periodically process it).


-Stut

--
http://stut.net/

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



Re: [PHP] Run Process in back ground

2008-02-11 Thread Daniel Brown
On Feb 11, 2008 2:23 PM, Richard Kurth [EMAIL PROTECTED] wrote:
 Is there a way that I can call a function that will send an email and
 then move on redirecting to another website without having to what for
 the email to send?
 SendEmail($memberemail,$MailFrom,$MailHost);
 header(Location:http://domain.com;);

There are a variety of ways, including setting a cron, running an
external script, or placing SendEmail() after the header(Location:
xxx) call and inserting ignore_user_abort(1) before redirecting the
user, in case PHP and Apache learn that the socket is closed to the
user.

-- 
/Dan

Daniel P. Brown
Senior Unix Geek
? while(1) { $me = $mind--; sleep(86400); } ?

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



Re: [PHP] Run Process in back ground

2008-02-11 Thread Per Jessen
Stut wrote:

 Yes:
 
 mail(  );
 header(Location:http://domain.com;);
 
 
 mail() only takes as long as it takes to drop the mail in your local
 filesystem.
 
 Not necessarily. As discussed at length on this list last month
 sendmail (or a substitute) may try to deliver the message rather than
 passing it to a local MTA.

True, a lot will depend on your local MTA.  If you're running postfix,
sendmail will always behave like I described.  
If you're running a local MTA (local=on the same machine), I would
expect sendmail to be very quick, but I have no experience with the
other MTAs (sendmail itself, exim, qmail et al.)



/Per Jessen, Zürich

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