Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/189389-mail/
Share on other sites

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.

 

 

Link to comment
https://forums.phpfreaks.com/topic/189389-mail/#findComment-999719
Share on other sites

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.

 

Link to comment
https://forums.phpfreaks.com/topic/189389-mail/#findComment-999726
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/189389-mail/#findComment-999917
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/189389-mail/#findComment-999919
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.