Reply to mail and displaying errors

Your name:

Reply:


Posted by Dudely on 05/04/07 21:00

I'm trying to debug someone else's third party code that I'm trying to
install on my site. It works for him on his site, but not for me on
"my" site.

I've traced the problem to the mail() call. For whatever reason, it's
failing. And, my question is - how do I make php print the real
reason for the failure?

I've modified his code (multiple times), so that it now looks like
this:

error_reporting(E_ALL);

$mail_sent = @mail($Email_Address, $subscribe_email_subject,
$subscribe_confirm_msg, "From: $DB_OwnerName < $DB_ReplyToEmail >", "-
f $DB_ReplyToEmail");
if ($mail_sent)
echo "Mail sent";
else
die ("Mail failed" . " in File: " . __FILE__ . " on line: " .
__LINE__ . " Error was:" . $mail_sent[1] );

It tells me the mail failed and in what file and on what line as
expected, but I can't figure out how to make it print the true &
actual error (such as "permission denied" or perhaps "no such file" or
whatever the true error is). Prior to my changes, it simply had the
mail function without the @ and without capturing the return value.

So my question is two-fold:
1) How do I print the actual error and
2) What should I be looking at to figure out why mail is failing to
send? Or to put it another way, what might be the possible reasons
mail is failing that I should be checking?

I'm on a Linux server, but I think he uses Windows to test his code,
though I'm not sure. I'm somewhat new to PHP, but am very computer
and programming literate in C. My goal is not to learn PHP, but just
to get this third party app. working on my web host.

Thank you

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация