Topic: broadcast emailer issues.

i installed the broadcast emailer and it gives me this error when i try to send an email:

An error was encountered
Error: Unable to send e-mail. Please contact the forum administrator with the following error message reported by the SMTP server: "501 5.5.4 Invalid Address ".

is it refering to the smtp address or an email address that it is trying to send to? does the plugin use php mail or does it use the smtp info i input in the admin options? note: i can send form mail via punbb with the link under usernames in posts so i know the smtp server info works which is just an ip in my case.

~James
FluxBB - Less is more

2

Re: broadcast emailer issues.

the same error I posted here months ago and no one could help ... hope there is something new this time big_smile

Re: broadcast emailer issues.

Some searching suggests that it may be a syntax error with the From or To address(es).

4 (edited by MadHatter 2006-08-01 12:52)

Re: broadcast emailer issues.

if the server address were bad you wouldnt get a 501 (which is an smtp response).  501 is a valid (negitive) response to everything except the initial connection response, QUIT and TURN.  most likely its a response to an email address you were requesting to send an email to.

take your data, and plug it in here for a line by line debug of whats going on:

<?php

// open a socket to the server
$sh = fsockopen('YOURSERVERHERE', 25);

echo "<pre>Recieved:\r\n";
while($buf = fread($sh)) {
    echo $buf;
}

// send helo to the server
echo "Sending: HELO\r\n";
fwrite($sh,"HELO MadHatter\r\n");

echo "Recieved:\r\n";
while($buf = fgets($sh)) {
    echo $buf;
}

// send who its from
echo "Sending: MAIL FROM you@yourdomain.com\r\n";
fwrite($sh, "MAIL FROM: you@yourdomain.com\r\n");

echo "Recieved:\r\n";
while($buf = fgets($sh)) {
    echo $buf;
}
// enter as many of this block as you have reciepients:
// start of TO block
echo "Sending: RCPT TO: you@yourdomain.com\r\n";
fwrite($sh, "RCPT TO: you@yourdomain.com\r\n");


echo "Recieved:\r\n";
while($buf = fgets($sh)) {
    echo $buf;
}
// end of to block

// send the email data
echo "Sending: DATA";
fwrite($sh, "DATA\r\n");

echo "Recieved:\r\n";
while($buf = fgets($sh)) {
    echo $buf;
}


echo "Sending: Subject:Hello\r\nThis is a sample email\r\n.\r\n";
fwrite($sh, "Subject:Hello\r\nThis is a sample email\r\n.\r\n");

echo "Recieved:\r\n";
while($buf = fgets($sh)) {
    echo $buf;
}

// close
fclose($sh);

echo "</pre>";

?>

it should give you a good idea where the problem lies.

5 (edited by Dr.Jeckyl 2006-08-01 07:23)

Re: broadcast emailer issues.

Recieved:
Sending: HELO
Sending: Recieved:
Sending: MAIL FROM drjeckyl723@gmail.com
Recieved:
Sending: RCPT TO: drjeckyl723@gmail.com
Recieved:
Sending: DATARecieved:
Sending: Subject:Hello
This is a sample email
.
Recieved:

does this mean everything should be peachy?

i'm also positive that all emails are valid since i only have 8 members and i've emailed them all before via gmail or hotmail.

~James
FluxBB - Less is more

Re: broadcast emailer issues.

I'd check the broadcast emailer to make sure they're adding all the email addresss correctly.  can you post the code or link to a download of the plugin?

Re: broadcast emailer issues.

I assume he's talking about the one on the PunBB download page. (Direct link)

Re: broadcast emailer issues.

guardian34 wrote:

I assume he's talking about the one on the PunBB download page. (Direct link)

yes this one.

thanks guys for the help.

~James
FluxBB - Less is more

9 (edited by MadHatter 2006-08-01 16:10)

Re: broadcast emailer issues.

comment out the original pun_mail and use this one to try to send it again.  sounds like an email address is being truncated.

function pun_mail($to, $subject, $message, $from = '')
{
    global $pun_config, $lang_common;

    // Default sender/return address
    if (!$from)
        $from = '"'.str_replace('"', '', $pun_config['o_board_title'].' '.$lang_common['Mailer']).'" <'.$pun_config['o_webmaster_email'].'>';

    // Do a little spring cleaning
    $to = trim(preg_replace('#[\n\r]+#s', '', $to));
    $subject = trim(preg_replace('#[\n\r]+#s', '', $subject));
    $from = trim(preg_replace('#[\n\r:]+#s', '', $from));

    $headers = 'From: '.$from."\r\n".'Date: '.date('r')."\r\n".'MIME-Version: 1.0'."\r\n".'Content-transfer-encoding: 8bit'."\r\n".'Content-type: text/plain; charset='.$lang_common['lang_encoding']."\r\n".'X-Mailer: PunBB Mailer';

    // Make sure all linebreaks are CRLF in message
    $message = str_replace("\n", "\r\n", pun_linebreaks($message));

    if ($pun_config['o_smtp_host'] != '') {        
        echo "<p>smtp_mail sending to: $to</p>";
        smtp_mail($to, $subject, $message, $headers);
    } else
    {
        // Change the linebreaks used in the headers according to OS
        if (strtoupper(substr(PHP_OS, 0, 3)) == 'MAC')
            $headers = str_replace("\r\n", "\r", $headers);
        else if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN')
            $headers = str_replace("\r\n", "\n", $headers);
        echo "<p>php_mail sending to: $to</p>";
        mail($to, $subject, $message, $headers);
    }
}

you should see some debug info, and it will print out the email addresses as they are sent.  if they show up truncated, then its getting messed up along the way.

once you get it figured out, you'll want to remove this function & use the old one.

10 (edited by Dr.Jeckyl 2006-08-01 17:23)

Re: broadcast emailer issues.

i replaced that code in mail.php in root/include/ and this is the result:

An error was encountered
Error: Unable to send e-mail. Please contact the forum administrator with the following error message reported by the SMTP server: "501 5.5.4 Invalid Address ".

BUT when i do form email i get the debug text(or emails sent to) at the top of the redirect/confirm page.

~James
FluxBB - Less is more