473,756 Members | 3,655 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

mail and displaying errors

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_Ad dress, $subscribe_emai l_subject,
$subscribe_conf irm_msg, "From: $DB_OwnerName < $DB_ReplyToEmai l >", "-
f $DB_ReplyToEmai l");
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

May 4 '07 #1
3 1897
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_Ad dress, $subscribe_emai l_subject,
$subscribe_conf irm_msg, "From: $DB_OwnerName < $DB_ReplyToEmai l >", "-
f $DB_ReplyToEmai l");
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.
js*******@attgl obal.net
=============== ===
May 4 '07 #2
On May 4, 3:41 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
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_Ad dress, $subscribe_emai l_subject,
$subscribe_conf irm_msg, "From: $DB_OwnerName < $DB_ReplyToEmai l >", "-
f $DB_ReplyToEmai l");
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...@attgl obal.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

May 4 '07 #3
Dudely wrote:
On May 4, 3:41 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
>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_reporti ng(E_ALL);
$mail_sent = @mail($Email_Ad dress, $subscribe_emai l_subject,
$subscribe_co nfirm_msg, "From: $DB_OwnerName < $DB_ReplyToEmai l >", "-
f $DB_ReplyToEmai l");
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...@attg lobal.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
It affects all users. If you're on a hosted system, you need to contact
your hosting company. They may not have an SMTP server set up on this
box, they may restrict it's use to non-web apps, they might require a
login - or any of a dozen other things.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
May 5 '07 #4

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

Similar topics

0
4481
by: Wayno | last post by:
Hoping someone can help me out with this problem. First problem, is I am unable to view my php error log. In my php.ini I have my log in /var/www/logs/php_error_log. However, it has remained empty. Secondly, my sendmail works fine from command prompt. However, when trying to send mail through a php script (I have tried a couple), it says it is succesfull, but my mail logs show nothing going out. No error messages. Can someone take a look...
8
5798
by: euang | last post by:
Hi, I have been using access 2000 for two years on WINDOWS NT to display dynamic aweb page using ASP My ISP has now changed to Windows 2003, and I am having major problems displaying information from MEMO fields within the Access 2000 database. I have not had any problems before displaying MEMO fields on NT and have tried various tips to resolve this issue but no luck so far. I was wondering if anyone had come accross a similar...
16
2704
by: SamMan | last post by:
May be a bit off-topic... When bots scan the web for e-mail address to use for spam, do they look at what the browser is displaying, or scan through the underlying HTML markup for e-mail addresses? At work, we have stopped displaying our webmaster e-mail on our pages and created a form that uses cgi to process and send the message. Our e-mail however, is hard coded as a variable in the form and sent to the script. Will harvesters...
8
5479
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I debug it in PHP designer, it works with no problems, I get the test email. If
20
8909
by: Peter E. Granger | last post by:
I'm having a strange problem (or at least it seems strange to me) trying to display a MessageBox in a VC++ .NET forms application. If I put the call to MessageBox::Show in the form's .h file, it works just fine. If I put the call in the .cpp file, I get the following two errors: error C2653: 'MessageBoxA': is not a class or namespace name error C2660: 'System::Windows::Forms::Control::Show': function does not take
1
10066
by: bobano | last post by:
Hi everyone, I am writing a POP3 Client program in Perl. You connect to a POP3 Server and have a running conversation with the mail server using commands from the RFC 1939 Post Office Protocol. This program can perform 5 options from a menu on your POP3 mail by logging in with the correct POP3 server along with a user name and password that you use to log in to your ISP. The user name and password as well as the server name are all hard-coded...
6
1973
by: Karl Groves | last post by:
I'm trying to work out a mail system which can send an attachment as well as an HTML formatted message (and a default plain text version). I found some pretty good code on PHP.net and modified it a little but I can't seem to get it to work. It attaches the file properly, but only displays the Plain Text message, even in an HTML-capable mail client. I'm guessing it has something to do with the placement of the boundaries,
2
2673
by: Ruud | last post by:
Just before leaving for a holiday my collegue modified this script. Now it won't send any body text (The data filled in on the form) and in an error condition it won't send any attachments either. Because I don't understand PHP I cannot find the error. Who is willing to help? regards Ruud
0
1736
by: WebCM | last post by:
PDO offers 3 modes of displaying errors: - silent mode - no errors - warnings - Warning: - exceptions - Exception: Which of them is the fastest and the most adequate for applications like CMS and forums? I've been using exceptions now. However, let's come to the point where EDITOR posts a filled FORM (message, article...). He cannot lose his work!
0
9456
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9275
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9872
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9843
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9713
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8713
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7248
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5142
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3358
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.