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
MarkTheDaemon
Former Team Member
Posts: 2770
Joined: Thu Oct 20, 2005 2:42 am
Location: United Kingdom
Name: Mark Barnes

Post by MarkTheDaemon » Fri Oct 21, 2005 12:35 am

Please see the other topic on this with answers @

http://www.phpbb.com/phpBB/viewtopic.php?t=334001

Mark

imo
Registered User
Posts: 3
Joined: Fri Oct 07, 2005 7:42 am

Re: This is what I did.

Post by imo » Thu Oct 27, 2005 2:53 pm

I still dont get this... by looking at what's going in the extra headers string, I can send a mail using PHP and the following code:

<?php
$extra_headers = "Reply-to: a@b.c\n";
$extra_headers = $extra_headers . "From: a@b.c\n";
$extra_headers = $extra_headers . "Return-Path: a@b.c\n";
$extra_headers = $extra_headers . "Message-ID: <" . md5(uniqid(time())) . "@b.c\n";
$extra_headers = $extra_headers . "MIME-Version: 1.0\n";
$extra_headers = $extra_headers . "Content-type: text/plain; charset=iso-8859-1";
$extra_headers = $extra_headers . "Content-transfer-encoding: 8bit\n";
$extra_headers = $extra_headers . "Date: " . date('r', time()) . "\n";
$extra_headers = $extra_headers . "X-Priority: 3\nX-MSMail-Priority: Normal\nX-Mailer: PHP\nX-MimeOLE: Produced By phpBB2\n" ;

echo mail("ian@imosystems.co.uk", "Test", "This is a mail test ", $extra_headers);
?>

yet I get the dreaded Line 237 error message in emailer.php.

beery
Registered User
Posts: 73
Joined: Sat Oct 05, 2002 7:49 am
Location: Bangkok , Thailand

Re: This is what I did.

Post by beery » Fri Apr 07, 2006 9:38 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 had changed it , but doesn't work for me. :cry:

User avatar
martigan39759
Registered User
Posts: 63
Joined: Wed Feb 21, 2007 7:01 pm

Re: This is what I did.

Post by martigan39759 » Wed Aug 13, 2008 11:42 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
WOW!! Thank you so so much Isaac!! I have been asking how to fix this for months and I kept getting the same answers from everyone! You are the first person to actually solve this and so easy too!! You are my hero! I couldn't thank you enough! Why do people have to make everything so complicated?? I have seen pages and pages of people going back and forth talking about the most mind boggingly inane boring computer gobbildy gook about ports and smtp and mysql php asp blah blah blah as I have ever seen in my life, ugh!!! And you just solved it with two lines of deleting code!! wow!! THANKS!!!!
Yes, I am a noob, a big fat stupid noob, please help.

User avatar
ric323
Former Team Member
Posts: 22909
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: Failed Sending Email ::PHP::

Post by ric323 » Thu Aug 14, 2008 12:41 am

I'm glad that fixed your problem too martigan39759, but that does NOT mean it is a universal solution.
Web hosts keep trying new ways to combat SPAM, and nearly always trip up another piece of software when they do. You're fortunate that your host did the same as his.
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions

Locked

Return to “2.0.x Support Forum”