Reply to Re: mail and displaying errors

Your name:

Reply:


Posted by Dudely on 05/04/07 23:51

On May 4, 3:41 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> 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.
> jstuck...@attglobal.net
> ==================- Hide quoted text -
>
> - Show quoted text -

Does the php.ini file affect all users, or is it set on a per user
basis? If the former, I don't have access. If the latter, should it
live in my home directory or somewhere else? What does/should it look
like (where can I get a sample to plop in)? I don't know if sendmail
runs all the time, but I do have access to the executable. I'm a user
with typical limited access on a web host that is hosting my web page.

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

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