Failed Sending Email ::PHP::

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
rhodopsin
Registered User
Posts: 16
Joined: Sat Oct 08, 2005 1:13 pm

Failed Sending Email ::PHP::

Post by rhodopsin » Sat Oct 15, 2005 10:22 am

I'm a simpleton and I've just managed to get a phpbb forum working on my website. But whilst testing the registration I get this:
Failed Sending Email ::PHP::
DEBUG MODE
Line:234
File: emailer.php


Any kind PHP Miester out there who can help - PLEASE

BadDiceB
Registered User
Posts: 14
Joined: Fri Mar 18, 2005 6:20 pm
Location: Netherlands
Contact:

Post by BadDiceB » Sat Oct 15, 2005 10:39 am

I got the same problem (just as some of the users).
Greetz,

Roy "Bad Dice" Bouwman

ieruiz
Registered User
Posts: 14
Joined: Mon Oct 10, 2005 9:33 pm

This is what I did.

Post by ieruiz » Sat Oct 15, 2005 10:41 am

I had the same trouble. This is how I got by it.

Make a copy first of the emailer.php file located in your INCLUDES subdirectory. Keep it as a backup.

Edit your emailer.php file.

Change all lines that read as follows:

$result = @mail($to, $this->subject, preg_replace("#(?<!\r)\n#s", "\n", $this->msg), $this->extra_headers);

Take out the ",$this->extra_headers" part so that it now looks like so:

$result = @mail($to, $this->subject, preg_replace("#(?<!\r)\n#s", "\n", $this->msg));

Replace the emailer.php file in your INCLUDES directory with your changed copy.

Have a beer.

Cheers,

Isaac
iMan

User avatar
lurttinen
Translator
Posts: 4670
Joined: Tue Sep 21, 2004 12:05 pm
Location: Tampere, Finland
Name: Martti Lokka
Contact:

Re: This is what I did.

Post by lurttinen » Sat Oct 15, 2005 11:26 am

No need to edit any files. it's a configuration issue...

This error comes, because php mail function is not allowed in your server.
Either talk to your host and ask if they would enable it, or use SMTP with correct settings to send mail.
Signature is here

ieruiz
Registered User
Posts: 14
Joined: Mon Oct 10, 2005 9:33 pm

Not my experience.

Post by ieruiz » Sat Oct 15, 2005 12:05 pm

I had exactly the same error. It went away when I took out the headers section.

The error returns when I put the headers section back in.

I Didn't need to talk to my provider - although I wouldn't discount your feedback: it may well be true that the ISP doesn't allow for it.

My advice: try editing as described. IF you still get the msg then contact your ISP.

Isaac
iMan

User avatar
Lumpy Burgertushie
Registered User
Posts: 66729
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Not my experience.

Post by Lumpy Burgertushie » Sat Oct 15, 2005 12:09 pm

ieruiz wrote: I had exactly the same error. It went away when I took out the headers section.

The error returns when I put the headers section back in.

I Didn't need to talk to my provider - although I wouldn't discount your feedback: it may well be true that the ISP doesn't allow for it.

My advice: try editing as described. IF you still get the msg then contact your ISP.

Isaac

question is, does your board send the emails after you changed the file.

if all you did was remove the error message, you have not fixed anything.

the fact remains that when you get that error, it means that the host has php mail function disabled on the server and you need to ask them how you can use their server to send your email.

robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

ieruiz
Registered User
Posts: 14
Joined: Mon Oct 10, 2005 9:33 pm

Post by ieruiz » Sat Oct 15, 2005 12:21 pm

Good question. Yes, my emails work when I remove the header section. They stop working when I put it back in.

If you look carefully at the code I changed, you'll see that it's the actual "send mail" function itself - not the error msg. Kind of pointless to do the latter.

The header bit that I removed controlled the FROM address in the email. My suspicion is that the FROM address generated by the board is not allowed by my ISP. I don't have sufficient PHP experience to "print out" what the default PHPBB value was. However, it's now working properly.



Isaac
iMan

rhodopsin
Registered User
Posts: 16
Joined: Sat Oct 08, 2005 1:13 pm

Re: This is what I did.

Post by rhodopsin » Sat Oct 15, 2005 1:06 pm

lurttinen wrote: No need to edit any files. it's a configuration issue...

This error comes, because php mail function is not allowed in your server.
Either talk to your host and ask if they would enable it, or use SMTP with correct settings to send mail.


I'll try this - thanx Lurttinen

rhodopsin
Registered User
Posts: 16
Joined: Sat Oct 08, 2005 1:13 pm

Re: This is what I did.

Post by rhodopsin » Sat Oct 15, 2005 1:07 pm

ieruiz wrote: I had the same trouble. This is how I got by it.

Make a copy first of the emailer.php file located in your INCLUDES subdirectory. Keep it as a backup.

Edit your emailer.php file.

Change all lines that read as follows:

$result = @mail($to, $this->subject, preg_replace("#(?<!\r)\n#s", "\n", $this->msg), $this->extra_headers);

Take out the ",$this->extra_headers" part so that it now looks like so:

$result = @mail($to, $this->subject, preg_replace("#(?<!\r)\n#s", "\n", $this->msg));

Replace the emailer.php file in your INCLUDES directory with your changed copy.

Have a beer.

Cheers,

Isaac


But if my question to my Server Provider doesn't work, I'll do this.

Thanx ieruiz :wink:

ISBB
Registered User
Posts: 25
Joined: Wed May 21, 2003 9:38 pm
Contact:

Post by ISBB » Tue Oct 18, 2005 2:12 am

Here is my question to you guys as well..

http://www.zr2nw.com & a vanilla install of 2.0.17 at www.dumontdunesonline.com

Both are hosted on the same server
both have email servers set up properly
Configuration is IDENTICAL in both setups

but yet i keep getting similar errors on the new install..
COMPUTERS SUCK!!!!!

bcoday302
Registered User
Posts: 1
Joined: Tue Oct 18, 2005 2:19 am

email problems too

Post by bcoday302 » Tue Oct 18, 2005 2:36 am

I am not even able to describe the email problem i am having but it sounds similar to those mentioned here.

My big question is HOW to edit the emailer.php document. I downloaded it using ftp program, opened the file in a text editor, but then could not find the text string indicated.

I know that you can somehow edit with a terminal command but I have no idea how to do that.

Anyone help?

Brian

dgwyn
Registered User
Posts: 2
Joined: Thu Oct 20, 2005 12:42 am

Re: This is what I did.

Post by dgwyn » Thu Oct 20, 2005 12:45 am

ieruiz wrote: I had the same trouble. This is how I got by it.

Make a copy first of the emailer.php file located in your INCLUDES subdirectory. Keep it as a backup.

Edit your emailer.php file.

Change all lines that read as follows:

$result = @mail($to, $this->subject, preg_replace("#(?<!\r)\n#s", "\n", $this->msg), $this->extra_headers);

Take out the ",$this->extra_headers" part so that it now looks like so:

$result = @mail($to, $this->subject, preg_replace("#(?<!\r)\n#s", "\n", $this->msg));

Replace the emailer.php file in your INCLUDES directory with your changed copy.

Have a beer.

Cheers,

Isaac



I just made this change to my forum and it worked perfectly. Thank you! And I also took your advice and had a drink to celebrate.

Thanks,
Dave

TCR_RREIA
Registered User
Posts: 2
Joined: Thu Oct 20, 2005 3:45 am
Location: Richmond Virginia
Contact:

Very Interesting

Post by TCR_RREIA » Thu Oct 20, 2005 3:53 am

Within my forum, I have two groups of members. One set has only a few members and the second group has over 100. When sending the email to the small group, it works fine. Send mass email to the group over 100 members and I get the DEBUG error message. Send mass email to All Users and the same error.

So I took out the , $this->extra_headers portion of the code in TWO places and tried it again. And it works. But this is the part I find strange - now my ISP's CGI mailer email address shows up as sender instead of MY email addy. What gives?

TCR_RREIA
Registered User
Posts: 2
Joined: Thu Oct 20, 2005 3:45 am
Location: Richmond Virginia
Contact:

Re: email problems too

Post by TCR_RREIA » Thu Oct 20, 2005 3:58 am

bcoday302 wrote: I am not even able to describe the email problem i am having but it sounds similar to those mentioned here.

My big question is HOW to edit the emailer.php document. I downloaded it using ftp program, opened the file in a text editor, but then could not find the text string indicated.

I know that you can somehow edit with a terminal command but I have no idea how to do that.

Anyone help?

Brian


I use Homesite for my editor but you can use Windows WordPad (under Accessories). Open the file using the Files of Type: All Documents and the PHP files will appear. Click edit and save then FTP back up.

You REALLY have to look for the line of code - it took me a few minutes myself.

jdog
Registered User
Posts: 5
Joined: Sun Nov 07, 2004 4:52 am

Re: This is what I did.

Post by jdog » Fri Oct 21, 2005 12:33 am

Isaac,

Thank you very much for this fix... there is a new problem though:
ieruiz wrote: Edit your emailer.php file.

Change all lines that read as follows:

$result = @mail($to, $this->subject, preg_replace("#(?<!\r)\n#s", "\n", $this->msg), $this->extra_headers);

Take out the ",$this->extra_headers" part so that it now looks like so:

$result = @mail($to, $this->subject, preg_replace("#(?<!\r)\n#s", "\n", $this->msg));


I did this and it is now sending the emails, however, there is a new problem. The emails now shown as from CGI-Mailer <cgi-mailer@perfora.net>

I need them to be from MyName@MyMessageboard.com

Is there any solution to this?

Locked

Return to “2.0.x Support Forum”