Linode Forum
https://forum.linode.com/

What exactly happens after PHP mail function is executed?
https://forum.linode.com/viewtopic.php?f=11&t=11465
Page 1 of 1

Author:  kaleidoscope [ Fri Dec 05, 2014 8:50 pm ]
Post subject:  What exactly happens after PHP mail function is executed?

Need help with a Linux question. What exactly happens after PHP mail function is executed? Let's say I sent out 10,000 emails in a for loop. The script finished executing. What now takes control for actually sending emails out? Are they scheduled / cached somewhere? (As I understand email is not sent instantly by these large numbers).

Author:  Vance [ Sat Dec 06, 2014 2:49 am ]
Post subject:  Re: What exactly happens after PHP mail function is executed

It runs the program defined in sendmail_path to submit the message for delivery. Even if you are running something like Postfix or qmail as the mail transfer agent (MTA) on your server, it will provide a suitable program (probably named "sendmail") to perform this function. Once the message is submitted, it will be queued for delivery by your MTA.

Note that it may be inefficient to send a large number of messages in a loop using mail() - PHP recommends looking at some alternatives for this purpose.

Author:  masonm [ Sat Dec 06, 2014 9:34 pm ]
Post subject:  Re: What exactly happens after PHP mail function is executed

https://github.com/php/php-src/blob/128 ... ail.c#L101

Page 1 of 1 All times are UTC-04:00
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/