473,756 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

mail function generates 500 internal server error

Hey,

I had a hard disc problem last week on my server. I replaced the disc and
copied al the files to the new hard disc, everything works fine again except
some php scripts that are using the mail() function. When executing these
scripts I get this error:
"500 Internal Server Error
The server encountered an internal error or misconfiguratio n and was unable
to complete your request.

Please contact the server administrator, we*******@mydom ain.com and inform
them of the time the error occurred, and anything you might have done that
may have caused the error.

More information about this error may be available in the server error log."
In my logs I find this:malformed header from script. Bad
header=/home/mydomain/dead.letter...: php-script

Does somebody know what the problem could be?

grt,

Lieven
May 12 '06 #1
11 12314
>I had a hard disc problem last week on my server. I replaced the disc and
copied al the files to the new hard disc, everything works fine again except
some php scripts that are using the mail() function. When executing these
scripts I get this error:
"500 Internal Server Error
The server encountered an internal error or misconfiguratio n and was unable
to complete your request.

Please contact the server administrator, we*******@mydom ain.com and inform
them of the time the error occurred, and anything you might have done that
may have caused the error.

More information about this error may be available in the server error log."
In my logs I find this:malformed header from script. Bad
header=/home/mydomain/dead.letter...: php-script
The program invoked by the mail() function (often sendmail) is generating
an error message, which is messing up your output since the web server
thinks it is supposed to be a CGI header, but it isn't.

Temporary workaround: output some text
(e.g. <html><head><ti tle>This is a title</title></head><body>\n")
*before* calling the mail function. You will see the error message
text in the output from your page. Then figure out what it means.
*SOMETHING* is wrong with the mail and it's saving it in a dead.letter
file because it can't deliver it.
Does somebody know what the problem could be?


Gordon L. Burditt
May 12 '06 #2
Temporary workaround: output some text
(e.g. <html><head><ti tle>This is a title</title></head><body>\n")
*before* calling the mail function. You will see the error message
text in the output from your page. Then figure out what it means.
*SOMETHING* is wrong with the mail and it's saving it in a dead.letter
file because it can't deliver it.

I have tried this, but I'm still receiving this error. The online line I
have in my php file is the line with the mail function.

grt,

Lieven
May 15 '06 #3
>> Temporary workaround: output some text
(e.g. <html><head><ti tle>This is a title</title></head><body>\n")
*before* calling the mail function. You will see the error message
text in the output from your page. Then figure out what it means.
*SOMETHING* is wrong with the mail and it's saving it in a dead.letter
file because it can't deliver it.

I have tried this, but I'm still receiving this error. The online line I
have in my php file is the line with the mail function.


When you see the error message, then click "view source" in your
browser and paste the exact text of the error message and everything
before it into a post.

Gordon L. Burditt
May 15 '06 #4
>
When you see the error message, then click "view source" in your
browser and paste the exact text of the error message and everything
before it into a post.

This is the source code, I replaced my domain with "mydomain":
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguratio n and was unable to complete
your request.</p>
<p>Please contact the server administrator,
we*******@mydom ain.be and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.</p>
<p>More information about this error may be available
in the server error log.</p>
<hr />
<address>Apac he/2.0.50 (Fedora) Server at www.mydomain.be Port 80</address>
</body></html>
May 15 '06 #5
Lieven wrote:
When you see the error message, then click "view source" in your
browser and paste the exact text of the error message and everything
before it into a post.


This is the source code, I replaced my domain with "mydomain":
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguratio n and was unable to complete
your request.</p>
<p>Please contact the server administrator,
we*******@mydom ain.be and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.</p>
<p>More information about this error may be available
in the server error log.</p>
<hr />
<address>Apac he/2.0.50 (Fedora) Server at www.mydomain.be Port 80</address>
</body></html>


Lieven,

Looks like your mail() function is aborting for some reason. I suspect it may
be taking one of the Apache processes with it.

Anything in your Apache log?

What MTA are you using, and is it running OK? I suspect this may be an in-house
system (since you talked about disk failure). Can you send mail from your email
program using the MTA on this system (not your ISP's)?
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
May 16 '06 #6
Lieven,

Looks like your mail() function is aborting for some reason. I suspect it
may be taking one of the Apache processes with it.

Anything in your Apache log?

What MTA are you using, and is it running OK? I suspect this may be an
in-house system (since you talked about disk failure). Can you send mail
from your email program using the MTA on this system (not your ISP's)?

I'm using sendmail. This is a server that is running a hostingsapplica tion
(ensim). It uses sendmail to send emails. My emailclient uses this server as
outgoing server and this is working fine, I downloaded a php class that
makes it possible to send mail by specifying a smtp sever and when I use
'localhost' as smtp server this is working fine. If I lower the security
level of a domain (this is a setting in my hostingsapplica tion), the mail
functions works again, but it is really unsecure to do this for all my
customers.
The only error that I find was the one I mentioned earlier, the 'malformed
header from script...'. Thnaks for your help!!

grt,

Lieven
May 16 '06 #7
Lieven wrote:
Lieven,

Looks like your mail() function is aborting for some reason. I suspect it
may be taking one of the Apache processes with it.

Anything in your Apache log?

What MTA are you using, and is it running OK? I suspect this may be an
in-house system (since you talked about disk failure). Can you send mail
from your email program using the MTA on this system (not your ISP's)?


I'm using sendmail. This is a server that is running a hostingsapplica tion
(ensim). It uses sendmail to send emails. My emailclient uses this server as
outgoing server and this is working fine, I downloaded a php class that
makes it possible to send mail by specifying a smtp sever and when I use
'localhost' as smtp server this is working fine. If I lower the security
level of a domain (this is a setting in my hostingsapplica tion), the mail
functions works again, but it is really unsecure to do this for all my
customers.
The only error that I find was the one I mentioned earlier, the 'malformed
header from script...'. Thnaks for your help!!

grt,

Lieven


Lieven,

Did you try asking the authors of the PHP class? Not knowing what it does (or
even which class it is) makes it impossible to tell what's going on.

Does a simple mail() command work? That would be the place to start if you're
asking in this group.
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
May 16 '06 #8

Lieven,

Did you try asking the authors of the PHP class? Not knowing what it does
(or even which class it is) makes it impossible to tell what's going on. This script is just the normal phpmailer
(http://phpmailer.sourceforge.net/), there you can specify that you want to
use smtp like this:
$mailman = new PHPMailer();

$mailman->IsSMTP();

Using this tool, sending mails from our php scripts works, but it is
impossible to ask all our customers to change their php scripts.
Does a simple mail() command work? That would be the place to start if
you're asking in this group.
No, that is the whole problem. The mail function doesn't work anymore. After
a hard disk crash I copied the whole corrupt hard disk to a new disk,
everything else is working perfectly afterworths except php scripts that are
using the mail() function are getting the internal server error. I didn't
change anything to my configuration files or didn't update any application
on the server. Only raisonable explenation I have is that their must be some
kind of file corrupt after copying it to the new disk.

grt,

Lieven

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

May 16 '06 #9
Rik
Lieven wrote:
No, that is the whole problem. The mail function doesn't work
anymore. After a hard disk crash I copied the whole corrupt hard
disk to a new disk, everything else is working perfectly afterworths
except php scripts that are using the mail() function are getting the
internal server error. I didn't change anything to my configuration
files or didn't update any application on the server. Only raisonable
explenation I have is that their must be some kind of file corrupt
after copying it to the new disk.


I'd say, allthough a terrible job, back up settings and files, and install
everything as new. Who knows what else has become corrupt, that you just
haven't found out? It could be a simple function that doesn't work, it could
you're having a major security risk somewhere.

Grtz,
--
Rik Wasmus
May 16 '06 #10

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

Similar topics

2
4900
by: Tanya | last post by:
Running a PHP mail script on Linux which has Exchange as the mail server. The script does not send mail to any internal email address but sends it to any other address outside its domain! Can somebody please help... Thanks Tanya www.bluent.co.in
5
11145
by: paul brown | last post by:
Hi, I have this website that contains an internal message system that allows users to send each other "email" messages. My client wants me to extend the system so that when a user receives an internal message, the system will send an actual email to the user's email address. here's the sample code: function notify_recipient()
1
2597
by: Raziel? | last post by:
Greetings, When Installing Visual Studio .NET the following error occurs: Internal Error 25300 I've tried setup in safemode and the same error occurs. The disk is brand new and clean.
7
2574
by: David Berry | last post by:
I'm trying to use a recordset inside of a function but I'm getting an "object required 'adoRS" error. At the top of the page I create my recordset, ex: dim strConnection, adoCN, adoRS, strSQL strConnection = <Connection> Set adoCN = server.CreateObject("ADODB.connection") Set adoRS = server.CreateObject("ADODB.recordset") adoCN.Open strConnection
8
2695
by: Drew | last post by:
I am trying to setup an error reporting system for our Intranet. We have a Windows 2000 Server with SQL Server and we have an Exchange Server 5.5. I need to set it up so I can use CDO mail. I have used CDO before, but have never set it up to work. I built a small little page with some CDO code on it, but I get an error when I try to run it. How can I set this up to send mail from the webserver to people in our facility? Thanks, Drew
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
2
4436
by: GD | last post by:
Hi, An intranet application, with a SMTP mail function that lets users to attach files with emails by selecting files in their local computers (through a file browser component), works perfect on my local machine. However, after deployment to a server that has Windows 2003 Sever installed, the mail function is able to attach the file created by the application. However, when users attach some files selected from their local machines, it...
0
2408
by: howardr101 | last post by:
Hi, Have hunted around on the groups and can't find anything, hence. I've tried this against 2 mail servers (mailtraq and hmailserver) and it occus with both. The problems seems to be that when the SMTPClient attaches to the server and the server sends it greeting message, if anything other than +OK is received by the client it throws an exception and falls over.
5
3247
by: Gordon | last post by:
I'm working on a reset password script for my CMS, that will generate a random password and email it to a user when they request one. The problem I am having is that the mails being sent out are beign marked as spam by our internal mail system and never reaching users' inboxes. I've also discovered that Yahoo Mail considers these mails to be spam, but it moves them to the spam folder instead of just dropping them. I wrote a simple...
0
9455
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
9271
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
9869
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...
0
9708
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...
1
7242
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
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5302
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3354
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2665
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.