optikalefx Posted October 17, 2010 Share Posted October 17, 2010 my server is using sendmail, but it takes about 60 seconds to send. And by send, i don't mean to recieve the message. I just have a simple mail call, and when i hit that page it takes about 60 sec to return a result to me. I look for a while on what might be causing, but i can't seem to find anything that i can test out. Anyone ever have this know whats going on? Quote Link to comment https://forums.phpfreaks.com/topic/216115-mail-takes-forever-to-send/ Share on other sites More sharing options...
BlueSkyIS Posted October 18, 2010 Share Posted October 18, 2010 at least on several servers I work on, outgoing mail is put into a queue and a mail script checks the queue every so often and sends out any email waiting to go out. thus, on systems I am familiar with, email sent via sendmail is not sent instantaneously. Quote Link to comment https://forums.phpfreaks.com/topic/216115-mail-takes-forever-to-send/#findComment-1123141 Share on other sites More sharing options...
optikalefx Posted October 18, 2010 Author Share Posted October 18, 2010 I don't really care how long it takes for the email to send. I do care that the php script takes 60 seconds to return meaning, the server is busy for 60 sec, meaning the user will think something is wrong and leave the page while email is trying to send. Plus you can't load the main website while the server is processing. Something has to be wrong because i've never had this happen before. Quote Link to comment https://forums.phpfreaks.com/topic/216115-mail-takes-forever-to-send/#findComment-1123143 Share on other sites More sharing options...
BlueSkyIS Posted October 18, 2010 Share Posted October 18, 2010 i misunderstood the problem. was the script running okay before, and the problem just started happening on a specific host. or is this a new script or installation? can you post the pertinent code? Quote Link to comment https://forums.phpfreaks.com/topic/216115-mail-takes-forever-to-send/#findComment-1123145 Share on other sites More sharing options...
optikalefx Posted October 20, 2010 Author Share Posted October 20, 2010 function email($to=NULL, $subject=NULL, $body=NULL) { mail($to,$subject, $body); } It worked on my last macbook, and its worked on every linux server i've ever used. For some reason my current macbook, and this ubuntu install both take forever. Quote Link to comment https://forums.phpfreaks.com/topic/216115-mail-takes-forever-to-send/#findComment-1124239 Share on other sites More sharing options...
BlueSkyIS Posted October 20, 2010 Share Posted October 20, 2010 are you using MAMP, another mac lamp install, or the default mac PHP install? Quote Link to comment https://forums.phpfreaks.com/topic/216115-mail-takes-forever-to-send/#findComment-1124241 Share on other sites More sharing options...
BlueSkyIS Posted October 20, 2010 Share Posted October 20, 2010 also, is your sendmail connecting to an smtp server to send mail? that could explain the delay. just brainstorming... Quote Link to comment https://forums.phpfreaks.com/topic/216115-mail-takes-forever-to-send/#findComment-1124247 Share on other sites More sharing options...
optikalefx Posted October 20, 2010 Author Share Posted October 20, 2010 using mamp, I don't think its going through an smtp server, i never set one up. Its important for me to note, that the mail never gets received on my mac, but on the server it does. Which shouldn't happen. So im thinkings there something wrong with both my machine and the server. Yeesh. Maybe port 25 is blocked, ill check. Quote Link to comment https://forums.phpfreaks.com/topic/216115-mail-takes-forever-to-send/#findComment-1124250 Share on other sites More sharing options...
BlueSkyIS Posted October 20, 2010 Share Posted October 20, 2010 i use mamp and mail() is instantaneous... sorry can't be of much help here. Quote Link to comment https://forums.phpfreaks.com/topic/216115-mail-takes-forever-to-send/#findComment-1124252 Share on other sites More sharing options...
optikalefx Posted October 20, 2010 Author Share Posted October 20, 2010 if you go into terminal and type "sendmail" do you get anything back? What is your php.ini setting for sendmail? thanks! Quote Link to comment https://forums.phpfreaks.com/topic/216115-mail-takes-forever-to-send/#findComment-1124254 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.