email - What makes PHP's mail() function so slow? -
i made quick php script on server containing call mail() , started testing it. html page loads instantly, assume means php containing call mail() finished executing. however, emails sent mail() ever being received every 10-20 minutes after call. why delay? mail() trigger external programs? (the emails being sent gmail email account if that's relevant)
the behavior seeing has nothing php's mail()
function. instead, smtp mail server php hands off message to, taking time deliver. service known a mail transport agent, or mta.
there lots of potential reasons won't delivered immediately. possibly, delay see greylisting on receiving server, meaning receiving mail server refuses accept message until sending server (which php script handed to) tries few times resend it. well-behaved mta's retry failed send attempts, spam servers don't, making simple effective method cutting down spam.
it simple long queue of messages on smtp server waiting sent, whereby yours waiting in line. (really greylisting more probable though)
most important remember though email not intended instantaneous , therefore never guaranteed instantaneous. in past decade or we've gotten accustomed , large email being delivered quickly, can never promise quick delivery.
Comments
Post a Comment