my_mail function fails unless $message is set (General)

by Charley @, Tuesday, September 08, 2009, 08:03 (5346 days ago)

Hi. I just installed the MLF and after hours of debugging I found out what has been causing users to get the 'mail server not available' error when registering for as a new user.

The my_mail function in function.inc.php will return true only if I add $message = '(some text)' immediately before if(@mail($to, $subject, $message, $headers)). I can only guess no values are being passed for the parameter $message in function my_mail. Anybody has any idea why the function is not receiving parameter values for the $message parameter? Does the value of $message come from template_c?

The forum is hosted by GoDaddy on a Windows shared hosting plan. Thanks!

my_mail function fails unless $message is set

by davwat, Thursday, September 10, 2009, 16:12 (5344 days ago) @ Charley

The forum is hosted by GoDaddy on a Windows shared hosting plan. Thanks!

If you do a search of the forum you will find a number of postings regarding the problem of mail on Windows servers.

my_mail function fails unless $message is set

by Charley, Thursday, September 10, 2009, 16:47 (5344 days ago) @ davwat

I forgot to post an update to my original question. I finally figured out what caused my_mail to fail. I added the following line immediately before the call to the mail function and now all is well:

$message = preg_replace('/(?<!\r)\n/', "\r\n", $message);

Thanks for the help anyway!

RSS Feed of thread