473,387 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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: ad***@localhosthome.com");
Feb 27 '06 #1
4 4470
cover wrote:
$to = stripslashes($to)."\r\n";


Might or might not be the cause, but you should remove the trailing CRLF
here.
JW
Feb 27 '06 #2
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,
Feb 28 '06 #3

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

Mar 1 '06 #4

"cover" <co****************@yahoo.com> wrote in message
news:4d********************************@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: ad***@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.
Mar 1 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Bruce W...1 | last post by:
In my effort to learn PHP I'm playing with some simple email scripts. They worked a few days ago but they stopped working. The only thing I've done to this Windows 2000 PC in this time was a...
14
by: Luka Milkovic | last post by:
Hello, I have a little problem and although it's little it's extremely difficult for me to describe it, but I'll try. I have written a program which extracts certain portions of my received...
4
by: Trond A. S. Andersen | last post by:
Hi, all! I'm trying to use the System.Web.Mail. "package" combinded with System.Web.Mail.SmtpMail in order to send MS Excel spreadsheets attached to mail messages. However, sending one single...
3
by: Phil Mc | last post by:
Hi has anyone come accross the problem.... with referance to System.Web.Mail.MailMessage and System.Web.Mail.SmtpMail THIS WORKS FINE mail=new MailMessage(); mail.From =...
2
by: Jan Agermose | last post by:
Im trying to send mail using this code: MailMessage mail = new MailMessage(); mail.From = "fejl@mydomain.com"; mail.Subject = "some subject"; mail.Priority = MailPriority.Normal;
8
by: Leszek | last post by:
Hi. Could you help solve the problem: i have a file that has two includes: //my script <?php include(.'/prog1.php'); include(.'/prog2.php'); ?>
4
by: k.visube | last post by:
In my ASP application,i need to send a formatted text mail (i.e with newline characters). here in my application i used a function in javascript which construts the mail body sample snippet ...
20
by: Hemant Shah | last post by:
Folks, I spent better part of morning debugging a problem and it turned out to be DB2_USE_ALTERNATE_PAGE_CLEANING registry variable. I am running DB2 8.2 on AIX 5.3 system: # oslevel...
1
by: Lenny | last post by:
I wrote this function to send an email the problem is that I do not receive any error from .net but the email is not delivered. smtp server is not local but from my ISP any suggestion on how to...
2
by: joseph2000 | last post by:
Hi, I have problem with e-mails which are being send via System.Web.Mail.SmtpMail class but before describing the problem itself first I'd like to show shortly what I'm doing on the server. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.