Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Problem sending emails - need to use -f paramter

Quote Reply
Problem sending emails - need to use -f paramter
Hi,

I am unable to send out emails to users because my isp requires that I use a -f parameter:

In order for the script to work, you need to specify, via a fifth -f parameter, the domain from which the mail is being sent. The PHP component uses SMTP (Simple Mail Transfer Protocol), and all Fasthosts' SMTP servers have filters which ensure that the data returned by either the first or fifth mail parameter relates to one of your domains hosted by Fasthosts.

e.g:

<?
mail( "yourname@yourdomain.com", "Feedback Form Results",
$message, "From: $email", "-fuser@userdomain.com" );
header( "Location: http://www.yourdomain.com/thankyou.html" );
?>

Where can I change this in the code?

Thanks,

Kerry
Quote Reply
Re: [tucklis] Problem sending emails - need to use -f paramter In reply to
for example I have setup a vbulletin installation and have changed it in the code here (highlighted in bold):



// ###################### Start vbmail #######################
// vBulletin wrapper for PHP's 'mail()' function
function vbmail($toemail, $subject, $message, $from = '', $headers = '', $username = '') {
global $bbtitle, $webmasteremail;

$toemail = trim($toemail);

if ($toemail) {

$subject = trim($subject);
$message = preg_replace("/(\r\n|\r|\n)/s", "\r\n", trim($message));
$from = trim($from);
$username = trim($username);

// work out the 'From' header
if ($from == '') {
$headers = "From: \"$bbtitle Mailer\" <$webmasteremail>\r\n" . $headers;
} else {
$headers = 'From: "' . iif($username, "$username @ $bbtitle", $from) . "\" <$from>\r\n" . $headers;
}

// actually send the email message
mail($toemail, $subject, $message, $headers, "-f$webmasteremail" );

return true;

} else {
return false;
}
}