Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter sillybilly

    (@sillybilly)

    Replaced wp_mail function to the following. Works fine.

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

    include_once ‘Net/SMTP.php’;
    $host = “my.smtp.host”;
    $port = 25;
    $from = “donotreply@my.web.site”;

    $text_headers = “From: $from\nTo: $to\nX-Mailer: Socket Mailer\nSubject: $subject\n$headers”;

    if (!($smtp = new Net_SMTP($host, $port))) { return false; }
    if (PEAR::isError($smtp->connect())) { return false; }
    if (PEAR::isError($smtp->mailFrom($from))) { return false; }
    if (PEAR::isError($res = $smtp->rcptTo($to))) { return false; }
    if (PEAR::isError($smtp->data($text_headers . “\n” . $message))) { return false; }

    $smtp->disconnect();
    return true;

    }

    Thread Starter sillybilly

    (@sillybilly)

    OK, understood.
    PHP invokes sendmail directly! Odd idea. Sendmail binary can’t be called directly by user nobody. Period.
    Now looking for a stub that does mail submission via socket.

    Thread Starter sillybilly

    (@sillybilly)

    Well, I suspect the prob is somewhere deeper.

    A test script from exampe at your URL worked fine, regardless of safe_mode directive. The wordpress function didn’t. Looking for user permissions…

    Thread Starter sillybilly

    (@sillybilly)

    HOW?

Viewing 4 replies - 1 through 4 (of 4 total)