the existing mail() code in commonfuncs.php is: mail( $email_to, $subject, $body, $headers, "-f")
i also found this code in http://php.net/function.mail: ------------------------------------------------------- Example 3. Sending mail with an additional command line parameter.
The additional_parameters parameter can be used to pass an additional parameter to the program configured to use when sending mail using the sendmail_path. <?php mail('nobody@example.com', 'the subject', 'the message', null, '-fwebmaster@example.com'); ?> ---------------------------------
i am not in a hurry though since i managed to fix it (at least the non-queue version)
I'm aware that some hosts need -f, which is why there's an option to use it on the Admin -> E-mails -> E-mail Preferences page. You haven't made it clear, so I don't know if you're saying you're using it or not. Are you unaware of the option, or are you saying it doesn't work as-is?
Comments on email problem with -f parameter
Experienced
Usergroup: Customer
Joined: Feb 22, 2004
Total Topics: 47
Total Comments: 88
recently i found out that i could not send any emails, i contacted my host and he gave me this code for proper mail() usage:
$email_to = "MY_TO_EMAIL@EMAIL.COM";
$email_from = "MY_FROM_EMAIL@EMAIL.COM";
$subject = "test subject";
$body = "TESTING ";
$headers = "From: " .$email_from ."\r\n";
mail( $email_to, $subject, $body, $headers, "-f" . $email_from )
the existing mail() code in commonfuncs.php is:
mail( $email_to, $subject, $body, $headers, "-f")
i also found this code in http://php.net/function.mail:
-------------------------------------------------------
Example 3. Sending mail with an additional command line parameter.
The additional_parameters parameter can be used to pass an additional parameter to the program configured to use when sending mail using the sendmail_path.
<?php
mail('nobody@example.com', 'the subject', 'the message', null,
'-fwebmaster@example.com');
?>
---------------------------------
i am not in a hurry though since i managed to fix it (at least the non-queue version)
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
I'm aware that some hosts need -f, which is why there's an option to use it on the Admin -> E-mails -> E-mail Preferences page. You haven't made it clear, so I don't know if you're saying you're using it or not. Are you unaware of the option, or are you saying it doesn't work as-is?
Experienced
Usergroup: Customer
Joined: Feb 22, 2004
Total Topics: 47
Total Comments: 88
I have set the option but it is not working, no emails are sent.It is because of the way the parameter is set in the mail() function.
Once i changed my mail() function in commonfuncs.php, it started to send emails:
mail($thisto, $thissubject, $thismessage, "From: webmaster@my-domain.com\r\n", "-fwebmaster@my-domain.com")
mail ($to, $subject, $message, "From: webmaster@my-domain.com\r\n", "-fwebmaster@my-domain.com");
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
Okay, I've tacked the email on after the -f now.