• Resolved Magle

    (@magle)


    Hi, I just installed wordpress and it runs fine with the exception of emails. Users do not receive the email with their password after registering. The reason for this seems to be that my server requires the use of the “fifth parameter” -f when sending mail. How and where do I change the wordpress code to include that, please?

    Thanks very much in advance
    Kind regards
    Frederik

Viewing 6 replies - 1 through 6 (of 6 total)
  • WordPress uses the PHP mail function. You can find that code in wp-includes/pluggable-functions.php.

    ********************
    Welcome to the WordPress Support Forums!

    Please help keep the Forums successful by reading:
    Using the Support Forums

    Also, remember the WordPress Codex and the FAQ pages.

    And, thank you, for letting us know if this information proves useful (or not)!
    ********************

    Thread Starter Magle

    (@magle)

    Thanks, my only problem now is to know exactly what to change and where to add the -f parameter in the code 🙂

    I’ll be doing some testing by trial and error, but if anyone should happen to know what exactly parts of the code to change I’d be very happy to know, thanks.

    In the article I mentioned above, http://us2.php.net/manual/en/ref.mail.php saw the trick of adding the -f parameter so this might work for you. So at approximately line 166 in wp-includes/pluggable-functions.php

    change

    return @mail($to, $subject, $message, $headers);

    to
    return @mail($to, $subject, $message, $headers, "-f magle@yourdomain.com");

    ——————–

    Please note that modifying core files is generally discouraged, so make a backup of the file(s) before changing anything–just in case it doesn’t work you’ll have something to fall back on. Also, remember you will need to ‘retrofit’ that change upon subsequent WordPress upgrades.

    ——————–

    Thread Starter Magle

    (@magle)

    Thanks a lot for your help MichaelH! That did the trick. The wordpress mail now works, though I should probably look into a way to configure the server so mails without the -f parameter gets accepted for delivery (but configuring sendmail is quite a daunting task, to me at least ;-).

    Thread Starter Magle

    (@magle)

    oh btw, I should note that there shouldn’t be a space between -f and the webmastermail (so it would be “-fmagle@yourdomain.com”), just in case someone else tries it.

    Thanks for the ‘fix’ and I also forgot to mention this plugin that has worked for others:
    http://www.coffee2code.com/archives/2004/06/28/plugin-wpphpmailer/

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Email not working – How to set -f parameter for email’ is closed to new replies.