PDA

View Full Version : phpbb2 email setting


mathfeel
02-10-2006, 02:28 AM
phpbb always return error regarding sendmail regardless.

Should I set it to use "sendmail" (/usr/sbin/sendmail) or smtp (mail.hostname.com)

if smtp what is the correct setting?

btw, does Bluhost support vbulletin, that's behind this forum?

edit: sendmail setting works. Kind of dump that I mis-typed my email address for admin account. Anway, now I wonder how do I delete this post.

dsch
02-10-2006, 02:47 AM
I use sendmail, no problems.

edit: Oops, I better read the whole post before posting...

sajuuk
06-28-2006, 09:49 AM
sorry to revive an old thread.

Ive been having trouble with the email on my phpbb boards (2.0.20)
I have tried both settings for emails and neither one works. When i try to use the emailer.php setting i get this error

Failed sending email :: PHP ::

DEBUG MODE

Line : 234
File : emailer.php

does anyone know how to fix this?

areidmtm
06-28-2006, 09:57 AM
we're going to have to see your code before we know what the problem is. Post your code from Line : 234 File : emailer.php

aqg
06-28-2006, 09:58 AM
We have a phpBB forum and recently we have this problem when people send PMs. The error we got is:

Failed sending email :: PHP ::
DEBUG MODE
Line : 236
File : emailer.php

The phpBB folks suggested that our host (bluehost) turned off php sendmail's function for our account. I don't know if this is true. Can you please check?

I also tried to configure the forum to use SMTP mail instead, using my account email address, but got a "connection refused" error.

Does anyone know how to fix this problem? Thanks.

sajuuk
06-28-2006, 10:11 AM
okay the code from line 234 (assuming i counted correctly):

message_die(GENERAL_ERROR, 'Failed sending email :: ' . (($this->use_smtp) ? 'SMTP' : 'PHP') . ' :: ' . $result, '', __LINE__, __FILE__);

areidmtm
06-28-2006, 10:14 AM
Ok that's really no help...can you post the whole file?

sajuuk
06-28-2006, 10:18 AM
I just tried to post it. its too long.

grant
06-28-2006, 10:26 AM
Could your outgoing port settings be throwing this off, maybe? I'm not sure, I haven't touched PHBB in quit a while and can't remember all the ins and outs of it. Just a thought, I'll shut up now.

areidmtm
06-28-2006, 10:28 AM
OK, I've acutally got that file. I have you made any changes to that file?

sajuuk
06-28-2006, 10:29 AM
i cant recall making any changes to the file.

areidmtm
06-28-2006, 10:33 AM
go into your PHPBB admin and select "Configuration" and go to the bottom under "Email Settings" and select "Use SMTP Server for email" to say YES and enter the info.

Server address: yourdomain.com
user: email user name (user@yourdomain.com)
pass: email password

You might want to make a forum email account for this.

Try that and see if that works better

sajuuk
06-28-2006, 10:38 AM
when i try using SMTP for email i get this error


Ran into problems sending Mail. Response: 550 message to verify they are valid."

DEBUG MODE

Line : 153
File : smtp.php

areidmtm
06-28-2006, 10:45 AM
Make sure that the emails are correct and that the admin email really does exists in your CPanel email accounts. You may also want to google that "PHPBB2 550 message to verify they are valid" and see if you can find anything

Vladd44
06-29-2006, 10:53 AM
Failed sending email :: PHP ::
DEBUG MODE
Line : 236
File : emailer.php

Is it a real email address? Or is it a forwarder?

When I moved my site to bluehost that gave me fits for a couple days, actually went in and disabled all the email until I had a solution.

Has been working for 11 months and 10 days since. :p

d2f2wall
07-14-2006, 09:47 PM
I have the same issue on box76. PHPbb, firefly and joomala will not send email from clean install with or with out fantastico. via send mail or smtp I have confirmed the smtp settings and have tried both bluehost and non blue host smtp accounts. no go I finally called them and opened a ticket that seems not to be going anywhere fast. I would like to know if you are on the same server as me to help prove it to be a server issue.
I have also copied my DB and all files to another server and it worked with out problem.
I too am looking for ideas for a next step I can take.

soulstice99
09-08-2006, 10:35 AM
Failed sending email :: PHP ::

DEBUG MODE

Line : 234
File : emailer.php

I get this error all the time. I too was told to talk to my webhost about their settings.

I was told by one fellow that "your host probably has a limitation on the number of emails you can send in an hour, and if you are spammed alot, you go over the host's hourly limit, and thereby get this emailer.php error".

Just wondering if there is any truth to this theory...

soulstice99
09-12-2006, 02:13 PM
any ideas??

Onyx
09-13-2006, 04:45 PM
Hi Guy!

I had the exact problem as you.

It seems it's because this was on a second domain.

so what I did is to set up a e-mail pop account, and used the SMTP information into phpbb. (make sure you click on use SMTP [yes] in phpbb config) (I used forum@domain.com) and then login using forum+domain.com as username and mail.domain.com as SMTP server.

also I created some forwarders of the e-mails I set up in phpbb such as the admin@domain.com to my normal address.

And everything works fine.

Hope it works for you.

Basil
09-14-2006, 05:35 AM
http://semlar.biz/bh/smtp.gif

keykey
10-04-2006, 01:00 PM
I get the following error:
Could not connect to smtp host : 111 : Connection refused
DEBUG MODE
Line : 112
File : smtp.php

here is what my php file says:
// Replacement or substitute for PHP's mail command
function smtpmail($mail_to, $subject, $message, $headers = '')
{
global $board_config;

// Fix any bare linefeeds in the message to make it RFC821 Compliant.
$message = preg_replace("#(?<!\r)\n#si", "\r\n", $message);

if ($headers != '')
{
if (is_array($headers))
{
if (sizeof($headers) > 1)
{
$headers = join("\n", $headers);
}
else
{
$headers = $headers[0];
}
}
$headers = chop($headers);

// Make sure there are no bare linefeeds in the headers
$headers = preg_replace('#(?<!\r)\n#si', "\r\n", $headers);

// Ok this is rather confusing all things considered,
// but we have to grab bcc and cc headers and treat them differently
// Something we really didn't take into consideration originally
$header_array = explode("\r\n", $headers);
@reset($header_array);

$headers = '';
while(list(, $header) = each($header_array))
{
if (preg_match('#^cc:#si', $header))
{
$cc = preg_replace('#^cc:(.*)#si', '\1', $header);
}
else if (preg_match('#^bcc:#si', $header))
{
$bcc = preg_replace('#^bcc:(.*)#si', '\1', $header);
$header = '';
}
$headers .= ($header != '') ? $header . "\r\n" : '';
}

$headers = chop($headers);
$cc = explode(', ', $cc);
$bcc = explode(', ', $bcc);
}

if (trim($subject) == '')
{
message_die(GENERAL_ERROR, "No email Subject specified", "", __LINE__, __FILE__);
}

if (trim($message) == '')
{
message_die(GENERAL_ERROR, "Email message was blank", "", __LINE__, __FILE__);
}

// Ok we have error checked as much as we can to this point let's get on
// it already.
if( !$socket = @fsockopen($board_config['smtp_host'], 25, $errno, $errstr, 20) )
{
message_die(GENERAL_ERROR, "Could not connect to smtp host : $errno : $errstr", "", __LINE__, __FILE__);
}

// Wait for reply
server_parse($socket, "220", __LINE__);

// Do we want to use AUTH?, send RFC2554 EHLO, else send RFC821 HELO
// This improved as provided by SirSir to accomodate
if( !empty($board_config['smtp_username']) && !empty($board_config['smtp_password']) )
{
fputs($socket, "EHLO " . $board_config['smtp_host'] . "\r\n");
server_parse($socket, "250", __LINE__);

fputs($socket, "AUTH LOGIN\r\n");
server_parse($socket, "334", __LINE__);

fputs($socket, base64_encode($board_config['smtp_username']) . "\r\n");
server_parse($socket, "334", __LINE__);

fputs($socket, base64_encode($board_config['smtp_password']) . "\r\n");
server_parse($socket, "235", __LINE__);
}
else
{
fputs($socket, "HELO " . $board_config['smtp_host'] . "\r\n");
server_parse($socket, "250", __LINE__);
}

// From this point onward most server response codes should be 250
// Specify who the mail is from....
fputs($socket, "MAIL FROM: <" . $board_config['board_email'] . ">\r\n");
server_parse($socket, "250", __LINE__);

// Specify each user to send to and build to header.
$to_header = '';

// Add an additional bit of error checking to the To field.
$mail_to = (trim($mail_to) == '') ? 'Undisclosed-recipients:;' : trim($mail_to);
if (preg_match('#[^ ]+\@[^ ]+#', $mail_to))
{
fputs($socket, "RCPT TO: <$mail_to>\r\n");
server_parse($socket, "250", __LINE__);
}

// Ok now do the CC and BCC fields...
@reset($bcc);
while(list(, $bcc_address) = each($bcc))
{
// Add an additional bit of error checking to bcc header...
$bcc_address = trim($bcc_address);
if (preg_match('#[^ ]+\@[^ ]+#', $bcc_address))
{
fputs($socket, "RCPT TO: <$bcc_address>\r\n");
server_parse($socket, "250", __LINE__);
}
}

@reset($cc);
while(list(, $cc_address) = each($cc))
{
// Add an additional bit of error checking to cc header
$cc_address = trim($cc_address);
if (preg_match('#[^ ]+\@[^ ]+#', $cc_address))
{
fputs($socket, "RCPT TO: <$cc_address>\r\n");
server_parse($socket, "250", __LINE__);
}
}

// Ok now we tell the server we are ready to start sending data
fputs($socket, "DATA\r\n");

// This is the last response code we look for until the end of the message.
server_parse($socket, "354", __LINE__);

// Send the Subject Line...
fputs($socket, "Subject: $subject\r\n");

// Now the To Header.
fputs($socket, "To: $mail_to\r\n");

// Now any custom headers....
fputs($socket, "$headers\r\n\r\n");

// Ok now we are ready for the message...
fputs($socket, "$message\r\n");

// Ok the all the ingredients are mixed in let's cook this puppy...
fputs($socket, ".\r\n");
server_parse($socket, "250", __LINE__);

// Now tell the server we are done and close the socket...
fputs($socket, "QUIT\r\n");
fclose($socket);

return TRUE;

my settings are
e-mail address: admin@mydomain.com
incoming/outgoing mailserver: mail.mydomain.com
Username: admin+mydomain.com
password: ***

I'm running phpbb 2.021 with no mods

Where have I gone wrong??

casperinmd
10-11-2006, 08:34 AM
If you are getting the Connection Refused error, please try this post: http://www.bluehostforum.com/showpost.php?p=13655&postcount=20

It worked fine for me, it seems bluehost won't allow SMTP connections, only locally sent mail.

dkinzer
10-11-2006, 06:06 PM
[...]it seems bluehost won't allow SMTP connections.
This is true if you use the usual port (port 25). It will work perfectly if you change to port 26. This can be done in the phpBB admin panel.

Below is a script that you can use to test SMTP capabilities. Paste this into a file, say testmail.php, and FTP it to a web-accessible directory on your site. Be sure to change "yourdomain.com" to your actual domain name and also change "pickauser" to a valid email user on your domain (two places). The assignment to $smtp_pass will need to be changed to match the email user password. Lastly, the $mail_to string will need to be changed to the destination email address.

After all of that, access the script via your web browser and the mail should be sent if you've set it up correctly. You can then change the port to 25 and verify that it fails.

This script is useful to demonstrate an email failure to the support folk. It is much easier to point them to this script and let them test it and see that it fails than to try to explain what's going on inside phpBB2 or osCommerce or whatever.
<?php
$domain = 'yourdomain.com';
$smtp_host = "mail.$domain";
$smtp_port = 26;
$smtp_user = "pickauser@$domain";
$smtp_pass = 'foobar';
$mail_from = "pickauser@$domain";
$subject = 'email check';

$headers = '';
$headers .= "From: $mail_from\n";
$headers .= "Return-Path: $mail_from\n";
$headers .= "Message-ID: <" . md5(uniqid(time())) . "@$domain>";
$headers .= "MIME-Version: 1.0";
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
$headers .= "Content-transfer-encoding: 8bit\n";
$headers .= "Date: " . date('r', time()) . "\n";
$headers .= "X-Priority: 3\n";
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Mailer: PHP\n";
$headers .= "X-MimeOLE: Produced By $domain\n";

$message = "This is a test.\n";

$mail_to = 'test@otherdomain.com';
smtpmail($smtp_host, $smtp_port, $smtp_user, $smtp_pass, $mail_to, $mail_from, $subject, $message, $headers);
echo "email sent to $mail_to using server $smtp_host/$smtp_user<br>";

function smtpmail($smtp_host, $smtp_port, $smtp_user, $smtp_pass, $mail_to, $mail_from, $subject, $message, $headers = '')
{
echo "host=[$smtp_host]<br>";
echo "port=[$smtp_port]<br>";
echo "user=[$smtp_user]<br>";
echo "pass=[$smtp_pass]<br>";
echo "from=[$mail_from]<br>";
echo " to=[$mail_to]<br>";

// Fix any bare linefeeds in the message to make it RFC821 Compliant.
$message = preg_replace("#(?<!\r)\n#si", "\r\n", $message);

if ($headers != '')
{
if (is_array($headers))
{
if (sizeof($headers) > 1)
{
$headers = join("\n", $headers);
}
else
{
$headers = $headers[0];
}
}
$headers = chop($headers);

// Make sure there are no bare linefeeds in the headers
$headers = preg_replace('#(?<!\r)\n#si', "\r\n", $headers);

// Ok this is rather confusing all things considered,
// but we have to grab bcc and cc headers and treat them differently
// Something we really didn't take into consideration originally
$header_array = explode("\r\n", $headers);
@reset($header_array);

$headers = '';
while(list(, $header) = each($header_array))
{
if (preg_match('#^cc:#si', $header))
{
$cc = preg_replace('#^cc:(.*)#si', '\1', $header);
}
else if (preg_match('#^bcc:#si', $header))
{
$bcc = preg_replace('#^bcc:(.*)#si', '\1', $header);
$header = '';
}
$headers .= ($header != '') ? $header . "\r\n" : '';
}

$headers = chop($headers);
$cc = explode(', ', $cc);
$bcc = explode(', ', $bcc);
}

echo "step 1<br>";
if (trim($subject) == '')
{
message_die("No email Subject specified", "", __LINE__, __FILE__);
}

echo "step 2<br>";
if (trim($message) == '')
{
message_die("Email message was blank", "", __LINE__, __FILE__);
}

echo "step 3<br>";
if( !$socket = @fsockopen($smtp_host, $smtp_port, $errno, $errstr, 20) )
{
message_die("Could not connect to smtp host : $errno : $errstr", "", __LINE__, __FILE__);
}

// Wait for reply
server_parse($socket, "220", __LINE__);

echo "step 4<br>";
if( !empty($smtp_user) && !empty($smtp_pass) )
{
fputs($socket, "EHLO " . $smtp_host . "\r\n");
server_parse($socket, "250", __LINE__);

fputs($socket, "AUTH LOGIN\r\n");
server_parse($socket, "334", __LINE__);

fputs($socket, base64_encode($smtp_user) . "\r\n");
server_parse($socket, "334", __LINE__);

fputs($socket, base64_encode($smtp_pass) . "\r\n");
server_parse($socket, "235", __LINE__);
}
else
{
fputs($socket, "HELO " . $smtp_host . "\r\n");
server_parse($socket, "250", __LINE__);
}

echo "step 5<br>";
// From this point onward most server response codes should be 250
// Specify who the mail is from....
fputs($socket, "MAIL FROM: <" . $mail_from . ">\r\n");
server_parse($socket, "250", __LINE__);

// Specify each user to send to and build to header.
$to_header = '';

// Add an additional bit of error checking to the To field.
$mail_to = (trim($mail_to) == '') ? 'Undisclosed-recipients:;' : trim($mail_to);
if (preg_match('#[^ ]+\@[^ ]+#', $mail_to))
{
fputs($socket, "RCPT TO: <$mail_to>\r\n");
server_parse($socket, "250", __LINE__);
}

// Ok now do the CC and BCC fields...
@reset($bcc);
while(list(, $bcc_address) = each($bcc))
{
// Add an additional bit of error checking to bcc header...
$bcc_address = trim($bcc_address);
if (preg_match('#[^ ]+\@[^ ]+#', $bcc_address))
{
fputs($socket, "RCPT TO: <$bcc_address>\r\n");
server_parse($socket, "250", __LINE__);
}
}

@reset($cc);
while(list(, $cc_address) = each($cc))
{
// Add an additional bit of error checking to cc header
$cc_address = trim($cc_address);
if (preg_match('#[^ ]+\@[^ ]+#', $cc_address))
{
fputs($socket, "RCPT TO: <$cc_address>\r\n");
server_parse($socket, "250", __LINE__);
}
}

// Ok now we tell the server we are ready to start sending data
fputs($socket, "DATA\r\n");

// This is the last response code we look for until the end of the message.
server_parse($socket, "354", __LINE__);

// Send the Subject Line...
fputs($socket, "Subject: $subject\r\n");

// Now the To Header.
fputs($socket, "To: $mail_to\r\n");

// Now any custom headers....
fputs($socket, "$headers\r\n\r\n");

// Ok now we are ready for the message...
fputs($socket, "$message\r\n");

// Ok the all the ingredients are mixed in let's cook this puppy...
fputs($socket, ".\r\n");
server_parse($socket, "250", __LINE__);

// Now tell the server we are done and close the socket...
fputs($socket, "QUIT\r\n");
fclose($socket);

return TRUE;
}

function server_parse($socket, $response, $line = __LINE__)
{
$server_response = '';

while (substr($server_response, 3, 1) != ' ')
{
if (!($server_response = fgets($socket, 256)))
{
message_die("Couldn't get mail server response codes", $line, __FILE__);
}
}

if (!(substr($server_response, 0, 3) == $response))
{
message_die("Ran into problems sending Mail. Response: $server_response", $line, __FILE__);
}
}

function message_die($msg_text = '', $err_line = '', $err_file = '')
{
if ( $err_line != '' && $err_file != '' )
{
$msg_text .= '<br /><br />Line : ' . $err_line . '<br />File : ' . basename($err_file);
}
echo "<html>\n<body>\n" . $msg_text . "</body>\n</html>";

exit;
}

?>

casahac
12-28-2006, 12:08 PM
This is true if you use the usual port (port 25). It will work perfectly if you change to port 26. This can be done in the phpBB admin panel.


I'll confess my ignorance here; where and exactly how do I make this change? The only port setting I find in the admin panel is the second line in the Configuration panel that sets the server port to port 80.

I'm still trying to get my phpbb to send a mass mail. It's a small group so the problem here is NOT the size of the group. I am getting the message:

Could not connect to smtp host : 111 : Connection refused

DEBUG MODE

Line : 112
File : smtp.php

I've tried several recommended fixes for this OTHER than changing the port and have gotten nowhere.

Thanks for any help,

casahac

dkinzer
12-28-2006, 07:07 PM
I'll confess my ignorance here; where and exactly how do I make this change?
Log in to the administration panel and choose 'Configuration' from the 'General Admin' section. Then scroll toward the bottom of the page of configuration items. You should find a section with the heading "Email Settings" which contains an item labelled "SMTP Port". Change it to 26.

My site runs on a dedicated IP but I suspect that this change will work with those that are using a shared IP as well. The phone support people should be able to confirm this. Alternately, you can simply use the test script that I proposed earlier in this thread. Simply copy/paste into a text file in your favorite text editor, change the first few lines to suite your site setup and then upload it to your site as test_mail.php or some such.

casahac
12-29-2006, 12:09 AM
Don,

In the email section, I have the following headings:

Admin Email Address
Email Signature
Use SMTP Server for email
SMTP Server Address
SMTP Username
SMTP Password

No mention of SMTP port.

This is version 2.0.22 running on my G4 Powermac.

Thanks,

John

dkinzer
12-29-2006, 08:39 AM
In the email section, I have the following headings [...] No mention of SMTP port.
Sorry, I forgot that I installed the configurable SMTP port (http://www.phpbb.com/phpBB/viewtopic.php?t=223402) mod on my forum. It is fairly easy to install manually and even easier if you use EasyMOD (also available at the phpBB site).

Mammoth
01-01-2007, 01:49 PM
Like others here, I too am having issues with phpBB sending email with Bluehost. I've configured phpBB to YES for sending email, configured my server as myBHdomain.com (also tried mail.myBHdomain.com), confgured the username as username@myBHdomain.com and tried username+myBHdomain.com made sure the password is correct and followed other suggestions on this thread such as changing the SMTP port to 26 from 25.


After all of this, I'm still getting this error when I try to send email from my phpBB board.

Response: 550 Administrative prohibition

Can anyone help, I've about exhausted my searches to figure this out.

Thanks,
Mammoth

casahac
01-02-2007, 03:47 PM
Like others here, I too am having issues with phpBB sending email with Bluehost. I've configured phpBB to YES for sending email, configured my server as myBHdomain.com (also tried mail.myBHdomain.com), confgured the username as username@myBHdomain.com and tried username+myBHdomain.com made sure the password is correct and followed other suggestions on this thread such as changing the SMTP port to 26 from 25.


After all of this, I'm still getting this error when I try to send email from my phpBB board.

Response: 550 Administrative prohibition

Can anyone help, I've about exhausted my searches to figure this out.

Thanks,
Mammoth

Mammoth,

This is what BH sent to me on this subject:

"the outgoing and incoming servers are mail.yourdomain.com or yourdomain.com both will work. You must use the full email account name for the username and then the email password you specified when creating the email account. You will want to use port 26 not 25 for the outgoing server port. You can create email accounts in the email manager of the cpanel. In email manager click the list/add/remove pop email accounts and then click add account."

I've not been able to get the configurable SMTP Port MOD to work for me, so I can't yet say that this advice will work. Please post here regarding any progress you make. Thanks!

casahac

dkinzer
01-02-2007, 06:20 PM
I recommend experimenting with the script that I posted earlier in this thread. It uses code very similar to that used by phpBB to send email via SMTP. When you get it working, transfer the settings to your phpBB configuration and you should be all set.

If you can't get that script to work, it is much easier to try to diagnose the cause of the problem than to do so directly with phpBB. Besides, it's much easier to try different settings than it is with phpBB configuration.

When it come time to do so, if you can't get phpBB to work with the Configurable SMTP Port MOD (I've been using it for over a year - it works) at the very least you can directly edit the code in includes/smtp.php but that shouldn't be necessary.

Mammoth
01-03-2007, 09:49 AM
I'm finally working.

As my last try I set "Use SMTP Server for email" back to "No" in phpBB and it now works. I believe the main change was setting it to email via port 26 which I had set before.

In regards to changing the port, since it was a one time deal for me and I didn't want to install a mod, I just modified the smtp.php script line as below. Where you see 26 now, it was 25.

if( !$socket = @fsockopen($board_config['smtp_host'], 26, $errno, $errstr, 20) )

Mammoth

dkinzer
01-03-2007, 10:42 AM
I set "Use SMTP Server for email" back to "No" in phpBB and it now works.Not that it matters, but that means that you're using the PHP mail() function instead of SMTP for email and the change you made to smtp.php is irrelevant.

See the send() function in includes/emailer.php for the details.

Mammoth
01-03-2007, 10:48 AM
Thanks, dkinzer.

It does matter as it's good to know.


Mammoth

PaLL3
03-15-2007, 05:23 AM
Hey guys.. i see someothers got the same problemo as me.. cant send email via phpbb2. So heres my fix, its crude but it works for me;

Open smtp.php and comment out line 125-132.

This worked for me.. hope it does for anyone else out there..

Regards
PaLL3

thomasw98
03-25-2007, 06:08 AM
I am using sendmail and was getting a connection not accepted error until i switched from port 25 to 26.

EthanLin
04-02-2007, 09:25 PM
I found that if I wanna send mail to user@mydomain.com, then smtp server will return "550 message to verify they are valid", but others are OK. Anyone know why?

PS. my mail service is on gmail.

bigcaat
04-22-2007, 12:03 PM
Hi Guy!
It seems it's because this was on a second domain.

so what I did is to set up a e-mail pop account, and used the SMTP information into phpbb. (make sure you click on use SMTP [yes] in phpbb config) (I used forum@domain.com) and then login using forum+domain.com as username and mail.domain.com as SMTP server.

also I created some forwarders of the e-mails I set up in phpbb such as the admin@domain.com to my normal address.

So do you mean use "forum@domain.com?" Or, "forum@seconddomain.com"?

I'm having trouble sending mass email. We've changed the port to 26. I've gotten bluehost to up my limit, but it still doesn't work. I was wondering if it was because the forum is on an addon domain.

So, then, does that mean I create these new emails as forum@originaldomain.com or forum@addondomain.com?

Thanks.
Caat

onlinewinner
04-24-2007, 08:25 AM
We have a phpBB forum and recently we have this problem when people send PMs. The error we got is:

Failed sending email :: PHP ::
DEBUG MODE
Line : 236
File : emailer.php

The phpBB folks suggested that our host (bluehost) turned off php sendmail's function for our account. I don't know if this is true. Can you please check?

I also tried to configure the forum to use SMTP mail instead, using my account email address, but got a "connection refused" error.

Does anyone know how to fix this problem? Thanks.
well, i can be of help!!!

bpappas
09-15-2007, 08:57 AM
I used the info dkinzer provided on 12-29-2006, 09:39 AM
(1) install EasyMOD (available at the phpBB site)
(2) install the configurable SMTP port (http://www.phpbb.com/phpBB/viewtopic.php?t=223402)
(3) use these settings:
e-mail: youremail@yoursite.com
use SMTP server for e-mail: YES
SMPT port: 26
SMTP username: youremail@yoursite.com
STTP password: your password
(4) send e-mail => it goes out

Then BlueHost bounces most of your messages for having exceeded their hourly limit.

bpappas
09-16-2007, 09:22 PM
BlueHost upped my hourly e-mail limit to 500. As default, it's 50.
Calling them is best. They told me they are behind in their e-mails.

Mtspace
10-27-2007, 07:22 PM
I'm sorry but none of this works for my site... All of it results in a different error...

Can someone at Bluehost actually get off their chairs and find a solution to this that works without us having to add addons to our sites?

I am on day 2 of this hosting account and if someone doesn't fix this we won't make day 5... This is exactly the kind of stuff that made me leave my last host (GoDaddy, and they aren't looking as bad as I thought right now)...

Guys we shouldn't have to rewrite our code to make this simple function work... We can't post in our forums or PM each other because of this emailer error...

This is ridiculas...

MT

Basil
10-28-2007, 06:33 AM
Check "no" for "use smtp server for email" since you aren't using an smtp server.

If that isn't the problem then you may have a valid issue, with phpbb, not bluehost.

Mtspace
10-29-2007, 07:05 PM
http://semlar.biz/bh/smtp.gif

Where do you do that, my site doesn't have this enabled, I'm using the built in emailer.php function... Come on guys... You're not helping these people...

Mt

Mtspace
10-29-2007, 07:15 PM
Check "no" for "use smtp server for email" since you aren't using an smtp server.

If that isn't the problem then you may have a valid issue, with phpbb, not bluehost.

No Basil, it is a valid issue with bluehost... I just moved this site to Bluehost 3 days ago (all files and all DB's, nothing changed code wise beyond URL's and server info) and for the last year the site was fine on the other host (which I may have to go back to)...

Now can someone who actually knows a fix post here, sorry but you're just popping off Basil... I mean no disrespect here but I've been doing this for more than a decade...

PhP-Nuke's emailer.php function works, the problem lies here at Bluehost most probably at the Apache level... We need a fix guys, one that actually works...

MT

Mtspace
10-29-2007, 07:25 PM
Sorry, I forgot that I installed the configurable SMTP port (http://www.phpbb.com/phpBB/viewtopic.php?t=223402) mod on my forum. It is fairly easy to install manually and even easier if you use EasyMOD (also available at the phpBB site).

What type of file is this... The file dowloaded says its a .mod file, there is no such thing as a .mod file... I'm all about using this to fix Bluehosts issue here but need to know how to install this...

Sorry to keep posting but this is ridiculas, some one at BH needs to actually address this and fix this...

Thanks...

MT

Basil
10-29-2007, 08:05 PM
http://imusingtheinternet.com/phpbb2/
Works fine for me. Didn't edit anything except enabling email verification and email-sending between users.

felgall
10-29-2007, 08:48 PM
Sorry to keep posting but this is ridiculas, some one at BH needs to actually address this and fix this...

Thanks...

MT

Have you actually contacted BlueHost support and discussed this with them or have you only posed about it on this user to user forum where BlueHost support staff rarely if ever visit and therefore will not see your comments.

chriscana
12-29-2007, 07:49 AM
I have the same problem.

Installed the port mod, set to 26.

Ran into problems sending Mail. Response: 503 valid RCPT command must precede DATA

Tried setting to no to use sendmail

Failed sending email :: PHP ::
DEBUG MODE
Line : 234
File : emailer.php

Support has been no help

felgall
12-29-2007, 11:54 AM
I just used an existing email address as the one used to send emails from phpBB (without changing it to use SMTP) and have never had a problem with it sending emails. If your copy of phpBB is not sending emails then it is something in the way that you have set it up that is what is stopping the emails being sent.

christian
01-03-2008, 10:52 AM
I have the same problem.

Installed the port mod, set to 26.

Ran into problems sending Mail. Response: 503 valid RCPT command must precede DATA

Tried setting to no to use sendmail

Failed sending email :: PHP ::
DEBUG MODE
Line : 234
File : emailer.php

Support has been no help

Have you found a solution, I have been having this problem for the last week or 2. I didn't change any settings, and somehow the emailer is failing.

Thanks
Christian

felgall
01-03-2008, 12:03 PM
Have you tried asking for help on the phpBB forums at http://www.phpbb.com/support/

BlueHost support are there to support the hosting itself and do not provide support for any of the millions of scripts that you can choose to install there. For support on phpBB you need to ask at the phpBB site.

sucker
01-14-2008, 09:45 AM
Well let me join this gang.
Today I asked about the same problem concerning phpbb2 and the email setup
I asked via there ticketing system for support.
I fell like a bing-bong-ball:
setup config' on phpbb2 then it does not work, then go to the phpbb2 forum, then go to Bluehost forum, then go to cPanel forum bing - bong -ping -pong etc :D

If you want to join my phpbb2 forum it is not possible, you can try http://ulrome.ruatliberty.com/forum/ (http://ulrome.ruatliberty.com/forum)
It works really well, but you cannot become a member because the email registration does not ****ing work:(
Have fun everyone! I am going to kill myself :eek: LOL

felgall
01-14-2008, 10:45 AM
Why don't you try upgrading to phpBB3?

sucker
01-14-2008, 03:02 PM
Why don't you try upgrading to phpBB3?
because i think that i will have to setup email and it wiil not work.
or did i read somewhere that phpbb3 has intragrated a Mod available to phpbb2 :)
This leads to the 3 questions :
Can it be done on bluehost?
Have you a phpbb3 forum running on bluehost?
will i have to start again and lose all my forum setup?

felgall
01-14-2008, 03:39 PM
I have a phpBB3 forum on BlueHost at http://railforum.felgall.com

It was originally a phpBB2 forum prior to my converting it. I ran the conversion on a web server running on my own computer and just uploaded the updated database tables etc back to BlueHost afterwards. I am not sure if running the upgrade directly against the online copy will run successfully or will have CPU issues, that may depend on the volume of data held for your forum.

calculoso
01-14-2008, 04:24 PM
Just noticed this kind of a problem on my forum too. It was all up and running perfectly fine (not using SMTP) until the latest Apache / PHP upgrade. It appears that there is now one more setting that I'll have to hunt down and figure out what isn't working correctly.

felgall
01-14-2008, 05:04 PM
If something stopped working as a result of the upgrade then use Live Chat to let support know so that they can track down the problem and fix it for you. Matt has placed an entry on his blog appologising to everyone for the recent problems and assuring everyone that his support staff will get it all fixed ASAP.

calculoso
01-16-2008, 11:15 AM
My email problem actually turned out to be totally unrelated to PHPBB. During the server upgrades (and subsequent domain problems) my email forwarding addresses were completely removed. I still had email accounts set up, so all of the emails were sitting there waiting to be retrieved, but were not forwarded as I wanted.

Just goes to show that I shouldn't have jumped to conclusions... Follow the trail all the way through!

DaveyK
11-03-2008, 10:36 AM
This is true if you use the usual port (port 25). It will work perfectly if you change to port 26. This can be done in the phpBB admin panel.

Below is a script that you can use to test SMTP capabilities. Paste this into a file, say testmail.php, and FTP it to a web-accessible directory on your site. Be sure to change "yourdomain.com" to your actual domain name and also change "pickauser" to a valid email user on your domain (two places). The assignment to $smtp_pass will need to be changed to match the email user password. Lastly, the $mail_to string will need to be changed to the destination email address.

After all of that, access the script via your web browser and the mail should be sent if you've set it up correctly. You can then change the port to 25 and verify that it fails.

This script is useful to demonstrate an email failure to the support folk. It is much easier to point them to this script and let them test it and see that it fails than to try to explain what's going on inside phpBB2 or osCommerce or whatever.
<?php
$domain = 'yourdomain.com';
$smtp_host = "mail.$domain";
$smtp_port = 26;
$smtp_user = "pickauser@$domain";
$smtp_pass = 'foobar';
$mail_from = "pickauser@$domain";
$subject = 'email check';

$headers = '';
$headers .= "From: $mail_from\n";
$headers .= "Return-Path: $mail_from\n";
$headers .= "Message-ID: <" . md5(uniqid(time())) . "@$domain>";
$headers .= "MIME-Version: 1.0";
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
$headers .= "Content-transfer-encoding: 8bit\n";
$headers .= "Date: " . date('r', time()) . "\n";
$headers .= "X-Priority: 3\n";
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Mailer: PHP\n";
$headers .= "X-MimeOLE: Produced By $domain\n";

$message = "This is a test.\n";

$mail_to = 'test@otherdomain.com';
smtpmail($smtp_host, $smtp_port, $smtp_user, $smtp_pass, $mail_to, $mail_from, $subject, $message, $headers);
echo "email sent to $mail_to using server $smtp_host/$smtp_user<br>";

function smtpmail($smtp_host, $smtp_port, $smtp_user, $smtp_pass, $mail_to, $mail_from, $subject, $message, $headers = '')
{
echo "host=[$smtp_host]<br>";
echo "port=[$smtp_port]<br>";
echo "user=[$smtp_user]<br>";
echo "pass=[$smtp_pass]<br>";
echo "from=[$mail_from]<br>";
echo " to=[$mail_to]<br>";

// Fix any bare linefeeds in the message to make it RFC821 Compliant.
$message = preg_replace("#(?<!\r)\n#si", "\r\n", $message);

if ($headers != '')
{
if (is_array($headers))
{
if (sizeof($headers) > 1)
{
$headers = join("\n", $headers);
}
else
{
$headers = $headers[0];
}
}
$headers = chop($headers);

// Make sure there are no bare linefeeds in the headers
$headers = preg_replace('#(?<!\r)\n#si', "\r\n", $headers);

// Ok this is rather confusing all things considered,
// but we have to grab bcc and cc headers and treat them differently
// Something we really didn't take into consideration originally
$header_array = explode("\r\n", $headers);
@reset($header_array);

$headers = '';
while(list(, $header) = each($header_array))
{
if (preg_match('#^cc:#si', $header))
{
$cc = preg_replace('#^cc:(.*)#si', '\1', $header);
}
else if (preg_match('#^bcc:#si', $header))
{
$bcc = preg_replace('#^bcc:(.*)#si', '\1', $header);
$header = '';
}
$headers .= ($header != '') ? $header . "\r\n" : '';
}

$headers = chop($headers);
$cc = explode(', ', $cc);
$bcc = explode(', ', $bcc);
}

echo "step 1<br>";
if (trim($subject) == '')
{
message_die("No email Subject specified", "", __LINE__, __FILE__);
}

echo "step 2<br>";
if (trim($message) == '')
{
message_die("Email message was blank", "", __LINE__, __FILE__);
}

echo "step 3<br>";
if( !$socket = @fsockopen($smtp_host, $smtp_port, $errno, $errstr, 20) )
{
message_die("Could not connect to smtp host : $errno : $errstr", "", __LINE__, __FILE__);
}

// Wait for reply
server_parse($socket, "220", __LINE__);

echo "step 4<br>";
if( !empty($smtp_user) && !empty($smtp_pass) )
{
fputs($socket, "EHLO " . $smtp_host . "\r\n");
server_parse($socket, "250", __LINE__);

fputs($socket, "AUTH LOGIN\r\n");
server_parse($socket, "334", __LINE__);

fputs($socket, base64_encode($smtp_user) . "\r\n");
server_parse($socket, "334", __LINE__);

fputs($socket, base64_encode($smtp_pass) . "\r\n");
server_parse($socket, "235", __LINE__);
}
else
{
fputs($socket, "HELO " . $smtp_host . "\r\n");
server_parse($socket, "250", __LINE__);
}

echo "step 5<br>";
// From this point onward most server response codes should be 250
// Specify who the mail is from....
fputs($socket, "MAIL FROM: <" . $mail_from . ">\r\n");
server_parse($socket, "250", __LINE__);

// Specify each user to send to and build to header.
$to_header = '';

// Add an additional bit of error checking to the To field.
$mail_to = (trim($mail_to) == '') ? 'Undisclosed-recipients:;' : trim($mail_to);
if (preg_match('#[^ ]+\@[^ ]+#', $mail_to))
{
fputs($socket, "RCPT TO: <$mail_to>\r\n");
server_parse($socket, "250", __LINE__);
}

// Ok now do the CC and BCC fields...
@reset($bcc);
while(list(, $bcc_address) = each($bcc))
{
// Add an additional bit of error checking to bcc header...
$bcc_address = trim($bcc_address);
if (preg_match('#[^ ]+\@[^ ]+#', $bcc_address))
{
fputs($socket, "RCPT TO: <$bcc_address>\r\n");
server_parse($socket, "250", __LINE__);
}
}

@reset($cc);
while(list(, $cc_address) = each($cc))
{
// Add an additional bit of error checking to cc header
$cc_address = trim($cc_address);
if (preg_match('#[^ ]+\@[^ ]+#', $cc_address))
{
fputs($socket, "RCPT TO: <$cc_address>\r\n");
server_parse($socket, "250", __LINE__);
}
}

// Ok now we tell the server we are ready to start sending data
fputs($socket, "DATA\r\n");

// This is the last response code we look for until the end of the message.
server_parse($socket, "354", __LINE__);

// Send the Subject Line...
fputs($socket, "Subject: $subject\r\n");

// Now the To Header.
fputs($socket, "To: $mail_to\r\n");

// Now any custom headers....
fputs($socket, "$headers\r\n\r\n");

// Ok now we are ready for the message...
fputs($socket, "$message\r\n");

// Ok the all the ingredients are mixed in let's cook this puppy...
fputs($socket, ".\r\n");
server_parse($socket, "250", __LINE__);

// Now tell the server we are done and close the socket...
fputs($socket, "QUIT\r\n");
fclose($socket);

return TRUE;
}

function server_parse($socket, $response, $line = __LINE__)
{
$server_response = '';

while (substr($server_response, 3, 1) != ' ')
{
if (!($server_response = fgets($socket, 256)))
{
message_die("Couldn't get mail server response codes", $line, __FILE__);
}
}

if (!(substr($server_response, 0, 3) == $response))
{
message_die("Ran into problems sending Mail. Response: $server_response", $line, __FILE__);
}
}

function message_die($msg_text = '', $err_line = '', $err_file = '')
{
if ( $err_line != '' && $err_file != '' )
{
$msg_text .= '<br /><br />Line : ' . $err_line . '<br />File : ' . basename($err_file);
}
echo "<html>\n<body>\n" . $msg_text . "</body>\n</html>";

exit;
}

?>

I have tried the above script and it works. I receive an e-mail to my yahoo account from my domain account.

When I use the same settings in my forum I get....

Ran into problems sending Mail. Response: 550 No Such User Here

DEBUG MODE

Line : 152
File : smtp.php

My forums private messaging using the PHP emailer worked about a year ago and then something happened. Now the PHP email woll not work nor will SMTP. Still haven figured it out. Any other ideas?

I'm using phpBB 2.0.17 and the Charcoal2 theme. Does the theme have anything to do with it?