• Hello everyone:

    I’ve got a problem with wordpress email notification when a comment is submitted: it doesn’t work. I don’t know if it’s an issue from PHPMailer, my hosting or what. I’ve suffered enough, would you help me??

Viewing 6 replies - 16 through 21 (of 21 total)
  • It gets weirder and weirder. In trying a few things, I set notification to be sent when comments are posted. I normally don’t bother with this since all comments require modification.

    I was quite surprised to find no post sent to let me know a comment required moderation, but a notification was sent as soon as I approved it!

    I wonder if one’s host does play a role. If I have the notifications sent to my gmail account, everything works perfectly. <sigh>

    I’m having the same issue, nothing will work, cforms, registration. I’m using 2.7 I’ve tried different email addresses, nothing works. Any other ideas?

    YEY
    ty so much for showing the light technopreneur

    was so hunger for a solution and it was here all the time

    and figured out that the problem was that wordpress was trying to authenticate in my localhost smtp server that didn’t require it.

    worked nicely

    ty again

    https://www.a-fotografia.com
    https://colacomgelo.com

    I had issues with the SMTP setup on GoDaddy using Windows hosting (haven’t tried it on Linux). Pretty much any call to wp_mail() fails. The SMTP server apparently doesn’t like “Bare LF”.

    The problem ended up being line breaks. If there was a \n in the content, the send would fail. If it was \r\n it would work. I think this goes for the headers as well. I was never able to get wp_mail() to work (which ultimately uses PHPMailer) but I was able to bypass it and use the regular old mail() function. This took me forever to figure out, so I hope it helps if this is your problem.

    function send_mail($to, $subject, $message) {
    $subject = ‘[‘ . get_bloginfo(‘name’) . ‘] ‘ . $subject;

    // strip out some chars that might cause issues, and assemble vars
    $site_name = str_replace(‘”‘, “‘”, $this->site_name);
    $site_email = str_replace(array(‘<‘, ‘>’), array(”, ”), $this->site_email);
    $charset = get_settings(‘blog_charset’);

    $headers = “From: \”{$site_name}\” <{$site_email}>\r\n”;
    $headers .= “MIME-Version: 1.0\r\n”;
    $headers .= “Content-Type: text/plain; charset=\”{$charset}\”\r\n”;

    $message = str_replace(“\r\n”, “\n”, $message);
    $message = str_replace(“\r”, “\n”, $message);
    $message = str_replace(“\n”, “\r\n”, $message);
    $message = trim($message);
    $result = mail($to, $subject, $message, $headers);
    return $result;

    //wp_mail() doesn’t work
    //return wp_mail($to, $subject, $message, $headers);
    }

    cgum,

    Can you further elaborate on what to do with that code? My client is on GoDaddy too and unfortunately I am stuck with no solutions for this problem! Thanks!

Viewing 6 replies - 16 through 21 (of 21 total)
  • The topic ‘Email notification doesn’t work!!’ is closed to new replies.