|
Posted by Jerry Stuckle on 05/04/07 22:41
Dudely wrote:
> 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
>
Do you have an SMTP server (i.e. sendmail) active on your machine, and
is your php.ini pointing at the executable?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|