• WP isn’t sending emails (although it says it is) when I create test users to inform them of the password. My mailbox is empty but WP doesn’t complain about not being able to send it. As my box has the minimum services running, is there a requirement for WP to use sendmail or exim or does it handle contacting the remote smpt server itself?

    Please help!

    Thanks.

Viewing 15 replies - 31 through 45 (of 57 total)
  • Is there just a way to stop WP from sending those mails and allow the user to pick thier own?

    Hi gang, I’m a Word Press newbie but I thought I would share my very simple solution to this problem IF; you are running on a Windows box AND you can modify the php.ini file in your Windows root directory.

    I made outgoing mail work on my new WP installation by editing the [mail function] parameters in php.ini to point at the SMTP server of my email provider. That’s it. No patches, no SMTP emulators.

    Here is the “before” version of the file;

    SMTP = localhost ; for Win32 only
    smtp_port = 25
    sendmail_from= me@localhost ; for Win32 only

    Here’s the “after” version;

    SMTP = mail.My-Provider-Use-Your-Own.com ; for Win32 only
    smtp_port = 25
    sendmail_from= MyEmail@Example.com ; for Win32 only

    Might work for you *Nix folks too.

    I finally figured out how to fix this. All you need to do is fix the mail function in pluggable-functions.php in your include directory.

    The function looks something like this:

    if ( !function_exists(‘wp_mail’) ) :
    function wp_mail($to, $subject, $message, $headers = ”) {
    if( $headers == ” ) {
    $headers = “MIME-Version: 1.0\n” .
    “From: ” . get_settings(‘admin_email’) . “\n” .
    “Content-Type: text/plain; charset=\”” . get_settings(‘blog_charset’) . “\”\n”;
    }

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

    For Brinkster, you want to rewrite it like this:

    if ( !function_exists(‘wp_mail’) ) :
    function wp_mail($to, $subject, $message, $headers = ”) {
    // if( $headers == ” ) {
    // $headers = “MIME-Version: 1.0\n” .
    // “From: ” . get_settings(‘admin_email’) . “\n” .
    // “Content-Type: text/plain; charset=\”” . get_settings(‘blog_charset’) . “\”\n”;
    // }
    //
    // return @mail($to, $subject, $message, $headers);

    require(“c:\php\includes\class.phpmailer.php”);

    $mail = new PHPMailer();

    $mail->IsSMTP();

    $mail->Host = “sendmail.brinkster.com”;

    $mail->SMTPAuth = true;

    $mail->Username = “User@yourdomain.com”;

    $mail->Password = “your-pass-here”;

    $mail->From = “User@yourdomain.com”;

    $mail->FromName = “User”;

    $mail->AddAddress($to);

    $mail->IsHTML(true);

    $mail->Subject = $subject;
    $mail->Body = $message;

    $mail->Send();

    }
    endif;

    This should be the simplest possible solution. You don’t have to change any other settings in any files. I had no access to the php.ini file or other external files because my host doesn’t permit it. So this is what I came up with using Brinkster’s documentation and what I was able to figure out from WordPress.

    Hope this helps!

    Crazy.

    i am hosting with crystaltech, whom i love…

    but i cannot figure out the particulars of revising pluggable-functions.php to work within their hosting environment…

    has anyone had success with crystaltech and figured out how to get the email functionality for wordpress to work correctly?

    Any help would be greatly appreciated!!

    thanks cy

    I have an interesting problem. I too am not receiving users passwords when they register. I have been looking over this discussion and noticed a lot of references to the file wp-includes/functions.php. Specifically the wp_mail area of the file. However when I searched the file for this area it doesn’t appear to exist! This is a fresh install, no previous editing of these files. Any ideas? If someone could post the full function that is supposted to be in that file so I can add it in that would be great! This is running on a linux box.

    I’m having this same problem hosting with GoDaddy. I’ve tried phpMailer with no success. I’ve searched the function files and can find no reference to wp_mail. The link to ryan’s patch doesn’t seem to be working anymore. Any suggestions? Thanks. 🙂

    I had the same problem. The blog resides with my host, and this is how I resolved the issue.

    In wp-includes/pluggable-functions.php on line 115 (in my editor) the code says:

    if ( !function_exists('wp_mail') ) :
    function wp_mail($to, $subject, $message, $headers = '') {
    if( $headers == '' ) {
    $headers = "MIME-Version: 1.0n" .
    "From: wordpress@" . preg_replace('#^www.#', '', strtolower($_SERVER['SERVER_NAME'])) . "n" .
    "Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"n";

    Note the “From: wordpress@” . preg_replace

    All I did was add a new standard email addy, for example:

    myemailprefix@ntlworld.com

    >”From: myemailprefix@”

    And amended the code to read:

    if ( !function_exists('wp_mail') ) :
    function wp_mail($to, $subject, $message, $headers = '') {
    if( $headers == '' ) {
    $headers = "MIME-Version: 1.0n" .
    "From: myemailprefix@" . preg_replace('#^www.#', '', strtolower($_SERVER['SERVER_NAME'])) . "n" .
    "Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"n";

    Note the “From: myemailprefix@”

    I’m guessing you need to use an email address provided by your host i.e. your usual address for your website.

    Anyway, it worked for me, so hope it helps someone.

    Frustration: WordPress 2.01 same issue. The admin account receives an email about a new user from wordpress@domain.com . I actually created an email account wordpress@domain.com; still nothing to the new user.

    Ideas?

    BUMP…same issue…

    I couldn’t get the registration notices to get sent until I loaded the wpPHPMailer plugin ( http://www.coffee2code.com/archives/2004/06/28/plugin-wpphpmailer/ and it works fine, BUT – i cannot figure out how to get the “From:” populated. I tried setting the hardcoding options in the Option setting for wpPHPMailer from within the admin GUI for WordPress – that prevented all mails from going out. then i tried altering the From: headers within the file: class.phpmailer.php – that didn’t work. and i’ve tried altering the pluggable-functions.php file as nicky_uk suggested above….nothing works!!

    it’s exceedingly frustrating, because many of my users have mail servers which dump any email lacking a “From:” header into the spam bucket.

    any suggestions??

    also, like digital472, i’ve searched and searched the functions.php file for the “wp_mail” function, and it doesn’t exist!!

    Me too , I think it does not work for windows+iis .
    ~~~~~~~~~~~~~~~~~~~~~
    The e-mail could not be sent.
    Possible reason: your host may have disabled the mail() function...
    ~~~~~~~~~~~~~~~~~~~~~

    http://ipopf.info/wp/wp-login.php?action=lostpassword

    Having the same problem on a cPanel host with add-on domains, but not with main domains. I watched the exim_reject_log while registering a new user and saw this:

    2006-06-20 01:33:06 1FsbfW-0004kG-0p H=(userdomain.com) [203.56.140.212] F=<> rejected after DATA: there is no valid sender in any header line

    But in wp-includes/pluggable-functions.php, I had already altered the wp_mail function to include an explicit and valid From: address:

    “From: gooduser@userdomain.com” . “\n” .

    So I’m really puzzled as to why exim thinks there’s no valid sender. Thoughts?

    More research: The exim_reject_log shows the error above, and also shows the mail headers, which include these lines:

    Envelope-from: <>
    and
    F From:

    So it’s clear that exim is dropping the welcome messages because it can’t find any From: information. None of the modifications to pluggable_functions.php I’ve found in this thread have made any difference.

    Then I found what I thought was going to be a breakthrough — phpinfo() showed “no value” for sendmail_from! So I added this to the .htaccess for the directory:

    php_value sendmail_from user@domain.com

    Now phpinfo() shows a valid send_mail_from value. Excellent. But no dice – If I tail the exim_reject_log and register a new user, I see that exim still sees no valid sender and refuses to send the message. Somehow it’s not picking up on the .htaccess directive for send_mail_from.

    Again, a simple PHP mail test script in the same directory sends out just fine – this is definitely a WordPress thing.

    Suggestions welcome.

    The problem has just developed for me. New blogs ALWAYS sent an email to the user to inform them of password, but all of a sudden they’ve stopped. Nobody’s done anything on the server and the qmail smtp server is still working just fine. I shall dig deep – might even tentatively try an upgrade to 2.03. Will let you know how it goes.

    I’ve got the 2.0.4 version of WP, I searched for the mail function in functions.php…and… THERE IS NONE
    I don’t know if I did something or functions have been replaced or… some weird alien ate my code…

    Any ideas?

Viewing 15 replies - 31 through 45 (of 57 total)
  • The topic ‘How does WP send the user registration email?’ is closed to new replies.