mastix Posted January 22, 2010 Share Posted January 22, 2010 would anyone know what would cause the mail() function in a webpage cease working? the page now stalls for 3 minutes and the mail does not get sent. This was working just fine up to yesterday!!!! no changes in the code, just stopped working. ISP very slow in addressing this. Please help if you have a clue! thanks Quote Link to comment Share on other sites More sharing options...
otuatail Posted January 22, 2010 Share Posted January 22, 2010 have you got the code you are using around the mail() function. Need more to go on. Desmond Quote Link to comment Share on other sites More sharing options...
mastix Posted January 22, 2010 Author Share Posted January 22, 2010 the interesting thing is that this script worked for months. The question is why did it stop working. thank you [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
gizmola Posted January 22, 2010 Share Posted January 22, 2010 It seem highly likely that something on the server is broken. Typically mail just dumps the email out to the mta using sendmail, unless otherwise configured. If your server is configured to send the mail to the ISP's email server, then it's highly likely that their server is having issues and php is hanging on script attempting to make an smtp connection to their server and relay the outbound email. Quote Link to comment Share on other sites More sharing options...
otuatail Posted January 22, 2010 Share Posted January 22, 2010 There is another obviouse reason. I have had this once. The mail function takes 5 parameters. mail($to,$subject,$message, $headers, '-froot@mywebsite.com'); It is possible that your provider has changed something. Mine did this to me. Try adding the 5th parameter with your website name. Desmond. Quote Link to comment Share on other sites More sharing options...
mastix Posted January 22, 2010 Author Share Posted January 22, 2010 thank you. could you please be more specific about the 5th parameter? Lets say website is www.mysite.com, the email address is me@mysite.com. what would the 5th parameter look like? Also, can I use a $email variable instead as email address in the 5th parameter? Quote Link to comment Share on other sites More sharing options...
otuatail Posted January 22, 2010 Share Posted January 22, 2010 In your case above it should be mail($to,$subject,$message, $headers, '-froot@mysite.com'); e.g $header = "From: dave@hotmail.com' <Dave>\r\nCC: john@hotmail.com <John>\r\n"; mail('Bill.gates@microsoft.com', 'Windows7', 'This dosnt work', $header, '-froot@mysite.com'); Desmond Quote Link to comment Share on other sites More sharing options...
oni-kun Posted January 22, 2010 Share Posted January 22, 2010 In your case above it should be mail($to,$subject,$message, $headers, '-froot@mysite.com'); e.g $header = "From: dave@hotmail.com' <Dave>\r\nCC: john@hotmail.com <John>\r\n"; mail('Bill.gates@microsoft.com', 'Windows7', 'This dosnt work', $header, '-froot@mysite.com'); Desmond Sorta. The -f parameter is just a weird concatinating glob. Are you sending your e-mails from admin@yoursite.com? Make the parameter -fadmin@site.com for example. Quote Link to comment Share on other sites More sharing options...
mastix Posted January 22, 2010 Author Share Posted January 22, 2010 thank you for your help. the host support finally figured it out and it is now working Quote Link to comment 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.