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 https://forums.phpfreaks.com/topic/189389-mail/ 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 https://forums.phpfreaks.com/topic/189389-mail/#findComment-999711 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 https://forums.phpfreaks.com/topic/189389-mail/#findComment-999713 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 https://forums.phpfreaks.com/topic/189389-mail/#findComment-999719 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, '[email protected]'); 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 https://forums.phpfreaks.com/topic/189389-mail/#findComment-999726 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 [email protected]. 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 https://forums.phpfreaks.com/topic/189389-mail/#findComment-999906 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, '[email protected]'); e.g $header = "From: [email protected]' <Dave>\r\nCC: [email protected] <John>\r\n"; mail('[email protected]', 'Windows7', 'This dosnt work', $header, '[email protected]'); Desmond Quote Link to comment https://forums.phpfreaks.com/topic/189389-mail/#findComment-999917 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, '[email protected]'); e.g $header = "From: [email protected]' <Dave>\r\nCC: [email protected] <John>\r\n"; mail('[email protected]', 'Windows7', 'This dosnt work', $header, '[email protected]'); Desmond Sorta. The -f parameter is just a weird concatinating glob. Are you sending your e-mails from [email protected]? Make the parameter [email protected] for example. Quote Link to comment https://forums.phpfreaks.com/topic/189389-mail/#findComment-999919 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 https://forums.phpfreaks.com/topic/189389-mail/#findComment-1000143 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.