Bluehost.com Web Hosting $6.95

Problem with Mail() - PHP 5 vs PHP 4

This is a discussion on Problem with Mail() - PHP 5 vs PHP 4 within the alt.comp.lang.php forums, part of the PHP Programming Forums category; In my PHP 5.0 at home, I'm using the following code to successfully write to a database and ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2006
cover
 
Posts: n/a
Default Problem with Mail() - PHP 5 vs PHP 4

In my PHP 5.0 at home, I'm using the following code to successfully
write to a database and also send out an email. For some reason, when
I take this code to work, it still writes to the database but doesn't
send mail so we're (me and the I.T. guy) trying to find out whether
it's the difference between PHP 4 or something else with email
security.

Does anyone here have experience with mail() in PHP 4 to know whether
PHP 4 had issues with mail() that were fixed with PHP 5 ???? We've
been chasing this from the mail server side at work when perhaps its
some nuance between versions of PHP.

Appreciate any help...

Chris


/* > $to = stripslashes($to); */
$to = stripslashes($to)."\r\n";
$subject = stripslashes($subject);
$text = stripslashes($text);
/* > mail('$to',$subject, $text); */
mail($to, $subject, $text, "From: admin@localhosthome.com");
Reply With Quote
  #2 (permalink)  
Old 02-27-2006
Janwillem Borleffs
 
Posts: n/a
Default Re: Problem with Mail() - PHP 5 vs PHP 4

cover wrote:
> $to = stripslashes($to)."\r\n";
>


Might or might not be the cause, but you should remove the trailing CRLF
here.


JW


Reply With Quote
  #3 (permalink)  
Old 02-28-2006
cover
 
Posts: n/a
Default Re: Problem with Mail() - PHP 5 vs PHP 4

On Mon, 27 Feb 2006 22:33:57 +0100, "Janwillem Borleffs"
<jw@jwscripts.com> wrote:

>cover wrote:
>> $to = stripslashes($to)."\r\n";
>>

>
>Might or might not be the cause, but you should remove the trailing CRLF
>here.


Thanks for the reply. I tried it after reading your post and no
change... Thanks again,
Reply With Quote
  #4 (permalink)  
Old 03-01-2006
finalwebsites.com
 
Posts: n/a
Default Re: Problem with Mail() - PHP 5 vs PHP 4


cover wrote:
> In my PHP 5.0 at home, I'm using the following code to successfully
> write to a database and also send out an email. For some reason, when
> I take this code to work, it still writes to the database but doesn't
> send mail so we're (me and the I.T. guy) trying to find out whether
> it's the difference between PHP 4 or something else with email
> security.
>
> Does anyone here have experience with mail() in PHP 4 to know whether
> PHP 4 had issues with mail() that were fixed with PHP 5 ???? We've
> been chasing this from the mail server side at work when perhaps its
> some nuance between versions of PHP.
>

Are you sure that this is happen because a diff. version of php?

what about the smtp settings in your php config?

--
regards Olaf
http://www.finalwebsites.com

Reply With Quote
  #5 (permalink)  
Old 03-01-2006
Jim Michaels
 
Posts: n/a
Default Re: Problem with Mail() - PHP 5 vs PHP 4


"cover" <coverlandNOSPAM914@yahoo.com> wrote in message
news:4d8602dnuuvlqgnkqnhfsf079un9es5jp2@4ax.com...
> In my PHP 5.0 at home, I'm using the following code to successfully
> write to a database and also send out an email. For some reason, when
> I take this code to work, it still writes to the database but doesn't
> send mail so we're (me and the I.T. guy) trying to find out whether
> it's the difference between PHP 4 or something else with email
> security.
>
> Does anyone here have experience with mail() in PHP 4 to know whether
> PHP 4 had issues with mail() that were fixed with PHP 5 ???? We've
> been chasing this from the mail server side at work when perhaps its
> some nuance between versions of PHP.
>
> Appreciate any help...
>
> Chris
>
>
> /* > $to = stripslashes($to); */
> $to = stripslashes($to)."\r\n";
> $subject = stripslashes($subject);
> $text = stripslashes($text);
> /* > mail('$to',$subject, $text); */
> mail($to, $subject, $text, "From: admin@localhosthome.com");


perhaps it's your from address is invalid on your mailserver.
or it could be php.ini

; For Win32 only.
;sendmail_from = me@example.com

; For Unix only. You may supply arguments as well (default:
"sendmail -t -i").
;sendmail_path =

; Force the addition of the specified parameters to be passed as extra
parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =

is set wrong.


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 03:34 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0