473,761 Members | 9,480 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can anyone see a problem with this email script?

Wondering if anyone can see an error with this script. I get a server
configuration error. THat could mean a module is not being loaded, but
maybe there's a syntax error here, can anyone spot it? Thanks

<?

Error_Reporting (E_ALL & ~E_NOTICE);
$subject="from ".$_REQUEST['Your_Name:'] ;
$headers= "From: ".$_REQUEST['Your_Email:'] ."\n";
$headers.='Cont ent-type: text/html; charset=iso-8859-1';
$message='';
while ($field = current($_REQUE ST)) {
if ((key($_REQUEST )!="Your_Name:" ) && (key($_REQUEST) !
="Your_Email :") && (key($_REQUEST) !="Message:") && (key($_REQUEST) !
="i")) {
$message.="<str ong>".key($_REQ UEST)."</strong>&nbsp;&n bsp;&nbsp;".
$field."<br>";
}
next($_REQUEST) ;
}
$message.="<br> ".$_REQUEST['Message:'];
mail($_REQUEST['recipient'], $subject, "
<html>
<head>
<title>Contac t letter</title>
</head>
<body>
<br>
".$message. "
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");

?>

Apr 9 '07 #1
20 1742
Pete Marsh kirjoitti:
Wondering if anyone can see an error with this script. I get a server
configuration error. THat could mean a module is not being loaded, but
maybe there's a syntax error here, can anyone spot it? Thanks

<?

Error_Reporting (E_ALL & ~E_NOTICE);
$subject="from ".$_REQUEST['Your_Name:'] ;
$headers= "From: ".$_REQUEST['Your_Email:'] ."\n";
$headers.='Cont ent-type: text/html; charset=iso-8859-1';
$message='';
while ($field = current($_REQUE ST)) {
if ((key($_REQUEST )!="Your_Name:" ) && (key($_REQUEST) !
="Your_Email :") && (key($_REQUEST) !="Message:") && (key($_REQUEST) !
="i")) {
$message.="<str ong>".key($_REQ UEST)."</strong>&nbsp;&n bsp;&nbsp;".
$field."<br>";
}
next($_REQUEST) ;
}
$message.="<br> ".$_REQUEST['Message:'];
mail($_REQUEST['recipient'], $subject, "
<html>
<head>
<title>Contac t letter</title>
</head>
<body>
<br>
".$message. "
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");

?>
Have you tried with the very simplest possible mail? I mean just leave
out all the form shit and custom headers and such and just try:

mail('y******** *@example.com', 'this is a test', 'Hello Kitty!');

And if you get a server configuration error with that, then it's not a
php problem, it's a configuration problem. If not, you can slowly start
adding the stuff you have above to your mail and then see where it goes
wrong.

BTW. It's not against the law or anything to have colons in field names,
but just to be on the safe side, I wouldn't use them. They serve no
purpouse and it's just not customary to do so. I actually had to test to
see if they really really work, and yes they do, but it's still quite
odd to do so. I was thinking the old "dots are converted to undescores"
trick...

--
Ra*********@gma il.com
"Olemme apinoiden planeetalla."
Apr 9 '07 #2
On Apr 9, 2:34 pm, Rami Elomaa <rami.elo...@gm ail.comwrote:
Pete Marsh kirjoitti:
Wondering if anyone can see an error with this script. I get a server
configuration error. THat could mean a module is not being loaded, but
maybe there's a syntax error here, can anyone spot it? Thanks
<?
Error_Reporting (E_ALL & ~E_NOTICE);
$subject="from ".$_REQUEST['Your_Name:'] ;
$headers= "From: ".$_REQUEST['Your_Email:'] ."\n";
$headers.='Cont ent-type: text/html; charset=iso-8859-1';
$message='';
while ($field = current($_REQUE ST)) {
if ((key($_REQUEST )!="Your_Name:" ) && (key($_REQUEST) !
="Your_Email :") && (key($_REQUEST) !="Message:") && (key($_REQUEST) !
="i")) {
$message.="<str ong>".key($_REQ UEST)."</strong>&nbsp;&n bsp;&nbsp;".
$field."<br>";
}
next($_REQUEST) ;
}
$message.="<br> ".$_REQUEST['Message:'];
mail($_REQUEST['recipient'], $subject, "
<html>
<head>
<title>Contac t letter</title>
</head>
<body>
<br>
".$message. "
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");
?>

Have you tried with the very simplest possible mail? I mean just leave
out all the form shit and custom headers and such and just try:

mail('your_em.. .@example.com', 'this is a test', 'Hello Kitty!');

And if you get a server configuration error with that, then it's not a
php problem, it's a configuration problem. If not, you can slowly start
adding the stuff you have above to your mail and then see where it goes
wrong.

BTW. It's not against the law or anything to have colons in field names,
but just to be on the safe side, I wouldn't use them. They serve no
purpouse and it's just not customary to do so. I actually had to test to
see if they really really work, and yes they do, but it's still quite
odd to do so. I was thinking the old "dots are converted to undescores"
trick...

--
Rami.Elo...@gma il.com
"Olemme apinoiden planeetalla."


hi yes your basic mail works, so it's something else.
it's a very weird set up I've inherited. They have the actual form
separated out and embeded in a flash app, so I can't even see it! Then
they ahve two separate php scripts, one to handle the form processing,
and this one to handle to email respone. but the form processor does
not seem to point to this email script. What a mess.

Apr 9 '07 #3
Pete Marsh kirjoitti:
On Apr 9, 2:34 pm, Rami Elomaa <rami.elo...@gm ail.comwrote:
>Pete Marsh kirjoitti:
>>Wondering if anyone can see an error with this script. I get a server
configurati on error. THat could mean a module is not being loaded, but
maybe there's a syntax error here, can anyone spot it? Thanks
<?
Error_Reporti ng(E_ALL & ~E_NOTICE);
$subject="fro m ".$_REQUEST['Your_Name:'] ;
$headers= "From: ".$_REQUEST['Your_Email:'] ."\n";
$headers.='Cont ent-type: text/html; charset=iso-8859-1';
$message='';
while ($field = current($_REQUE ST)) {
if ((key($_REQUEST )!="Your_Name:" ) && (key($_REQUEST) !
="Your_Email: ") && (key($_REQUEST) !="Message:") && (key($_REQUEST) !
="i")) {
$message.="<str ong>".key($_REQ UEST)."</strong>&nbsp;&n bsp;&nbsp;".
$field."<br>" ;
}
next($_REQUEST) ;
}
$message.="<b r>".$_REQUEST['Message:'];
mail($_REQUES T['recipient'], $subject, "
<html>
<head>
<title>Contac t letter</title>
</head>
<body>
<br>
".$message. "
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");
?>
Have you tried with the very simplest possible mail? I mean just leave
out all the form shit and custom headers and such and just try:

mail('your_em. ..@example.com' ,'this is a test', 'Hello Kitty!');

And if you get a server configuration error with that, then it's not a
php problem, it's a configuration problem. If not, you can slowly start
adding the stuff you have above to your mail and then see where it goes
wrong.

BTW. It's not against the law or anything to have colons in field names,
but just to be on the safe side, I wouldn't use them. They serve no
purpouse and it's just not customary to do so. I actually had to test to
see if they really really work, and yes they do, but it's still quite
odd to do so. I was thinking the old "dots are converted to undescores"
trick...

--
Rami.Elo...@gm ail.com
"Olemme apinoiden planeetalla."

hi yes your basic mail works, so it's something else.
it's a very weird set up I've inherited. They have the actual form
separated out and embeded in a flash app, so I can't even see it! Then
they ahve two separate php scripts, one to handle the form processing,
and this one to handle to email respone. but the form processor does
not seem to point to this email script. What a mess.
Well you could try looking at what the form actually passes to the
script. Put something like this at the very beginning of your mail script:

file_put_conten ts('my_mail_log .txt', print_r($_REQUE ST, 1));

Kinda like trap what it's trying to send and try to figure out if
there's something wrong there, missing parameters or something.

The form being flash explains the colons though... Flash designers...

--
Ra*********@gma il.com
"Olemme apinoiden planeetalla."
Apr 10 '07 #4
On Apr 10, 12:47 am, Rami Elomaa <rami.elo...@gm ail.comwrote:
Pete Marsh kirjoitti:
On Apr 9, 2:34 pm, Rami Elomaa <rami.elo...@gm ail.comwrote:
Pete Marsh kirjoitti:
>Wondering if anyone can see an error with this script. I get a server
configuratio n error. THat could mean a module is not being loaded, but
maybe there's a syntax error here, can anyone spot it? Thanks
<?
Error_Reportin g(E_ALL & ~E_NOTICE);
$subject="fr om ".$_REQUEST['Your_Name:'] ;
$headers= "From: ".$_REQUEST['Your_Email:'] ."\n";
$headers.='Cont ent-type: text/html; charset=iso-8859-1';
$message='';
while ($field = current($_REQUE ST)) {
if ((key($_REQUEST )!="Your_Name:" ) && (key($_REQUEST) !
="Your_Email:" ) && (key($_REQUEST) !="Message:") && (key($_REQUEST) !
="i")) {
$message.="<str ong>".key($_REQ UEST)."</strong>&nbsp;&n bsp;&nbsp;".
$field."<br> ";
}
next($_REQUEST) ;
}
$message.="<br >".$_REQUEST['Message:'];
mail($_REQUE ST['recipient'], $subject, "
<html>
<head>
<title>Contac t letter</title>
</head>
<body>
<br>
".$message. "
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");
?>
Have you tried with the very simplest possible mail? I mean just leave
out all the form shit and custom headers and such and just try:
mail('your_em.. .@example.com', 'this is a test', 'Hello Kitty!');
And if you get a server configuration error with that, then it's not a
php problem, it's a configuration problem. If not, you can slowly start
adding the stuff you have above to your mail and then see where it goes
wrong.
BTW. It's not against the law or anything to have colons in field names,
but just to be on the safe side, I wouldn't use them. They serve no
purpouse and it's just not customary to do so. I actually had to test to
see if they really really work, and yes they do, but it's still quite
odd to do so. I was thinking the old "dots are converted to undescores"
trick...
--
Rami.Elo...@gma il.com
"Olemme apinoiden planeetalla."
hi yes your basic mail works, so it's something else.
it's a very weird set up I've inherited. They have the actual form
separated out and embeded in a flash app, so I can't even see it! Then
they ahve two separate php scripts, one to handle the form processing,
and this one to handle to email respone. but the form processor does
not seem to point to this email script. What a mess.

Well you could try looking at what the form actually passes to the
script. Put something like this at the very beginning of your mail script:

file_put_conten ts('my_mail_log .txt', print_r($_REQUE ST, 1));

Kinda like trap what it's trying to send and try to figure out if
there's something wrong there, missing parameters or something.

The form being flash explains the colons though... Flash designers...

Unfortunately, the form is embedded in a flash binary!
I cannot see the source code at this time.
Unbelievable!

Apr 10 '07 #5
Pete Marsh kirjoitti:
On Apr 10, 12:47 am, Rami Elomaa <rami.elo...@gm ail.comwrote:
>Pete Marsh kirjoitti:
>>On Apr 9, 2:34 pm, Rami Elomaa <rami.elo...@gm ail.comwrote:
Pete Marsh kirjoitti:
Wondering if anyone can see an error with this script. I get a server
configurati on error. THat could mean a module is not being loaded, but
maybe there's a syntax error here, can anyone spot it? Thanks
<?
Error_Repor ting(E_ALL & ~E_NOTICE);
$subject="f rom ".$_REQUEST['Your_Name:'] ;
$headers= "From: ".$_REQUEST['Your_Email:'] ."\n";
$headers.='Cont ent-type: text/html; charset=iso-8859-1';
$message='';
while ($field = current($_REQUE ST)) {
if ((key($_REQUEST )!="Your_Name:" ) && (key($_REQUEST) !
="Your_Emai l:") && (key($_REQUEST) !="Message:") && (key($_REQUEST) !
="i")) {
$message.="<str ong>".key($_REQ UEST)."</strong>&nbsp;&n bsp;&nbsp;".
$field."<br >";
}
next($_REQUEST) ;
}
$message.=" <br>".$_REQUE ST['Message:'];
mail($_REQU EST['recipient'], $subject, "
<html>
<head>
<title>Contac t letter</title>
</head>
<body>
<br>
".$message. "
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");
?>
Have you tried with the very simplest possible mail? I mean just leave
out all the form shit and custom headers and such and just try:
mail('your_e m...@example.co m','this is a test', 'Hello Kitty!');
And if you get a server configuration error with that, then it's not a
php problem, it's a configuration problem. If not, you can slowly start
adding the stuff you have above to your mail and then see where it goes
wrong.
BTW. It's not against the law or anything to have colons in field names,
but just to be on the safe side, I wouldn't use them. They serve no
purpouse and it's just not customary to do so. I actually had to test to
see if they really really work, and yes they do, but it's still quite
odd to do so. I was thinking the old "dots are converted to undescores"
trick...
--
Rami.Elo...@ gmail.com
"Olemme apinoiden planeetalla."
hi yes your basic mail works, so it's something else.
it's a very weird set up I've inherited. They have the actual form
separated out and embeded in a flash app, so I can't even see it! Then
they ahve two separate php scripts, one to handle the form processing,
and this one to handle to email respone. but the form processor does
not seem to point to this email script. What a mess.
Well you could try looking at what the form actually passes to the
script. Put something like this at the very beginning of your mail script:

file_put_conte nts('my_mail_lo g.txt', print_r($_REQUE ST, 1));

Kinda like trap what it's trying to send and try to figure out if
there's something wrong there, missing parameters or something.

The form being flash explains the colons though... Flash designers...


Unfortunately, the form is embedded in a flash binary!
I cannot see the source code at this time.
Unbelievable!
That's quite alright. That's why I told you to check what the form sends
to the mail script. Insert this line at the beginning of the mailer
script so you'll see what the flash form sends to the mailer, even if
you can't see what is happening inside the flash:

file_put_conten ts('my_mail_log .txt', print_r($_REQUE ST, 1));

And then try sending mail from the flash application and study the
results in my_mail_log.txt .

--
Ra*********@gma il.com
"Olemme apinoiden planeetalla."
Apr 10 '07 #6
Pete Marsh wrote:
mail($_REQUEST['recipient']
SPAMMER!

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Apr 10 '07 #7

Toby A Inkster;60036 Wrote:
Pete Marsh wrote:
mail($_REQUEST['recipient']

SPAMMER!

Why do you say that?

FFMG
--
FFMG

'webmaster forum' (http://www.httppoint.com) | 'webmaster Directory'
(http://www.webhostshunter.com/) | 'Recreation Vehicle insurance'
(http://www.insurance-owl.com/other/car_rec.php)
http://urlkick.com/-Free URL redirection service
------------------------------------------------------------------------
FFMG's Profile: http://www.httppoint.com/member.php?userid=580
View this thread: http://www.httppoint.com/showthread.php?t=13789

Message Posted via the webmaster forum http://www.httppoint.com, (Ad revenue sharing).

Apr 10 '07 #8
FFMG wrote:
Toby A Inkster;60036 Wrote:
>Pete Marsh wrote:
>>mail($_REQUES T['recipient']

SPAMMER!

Why do you say that?
http://pete-marsh.example.com/sc****...**@example.net

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Apr 10 '07 #9

Toby A Inkster;60073 Wrote:
FFMG wrote:
Toby A Inkster;60036 Wrote:
Pete Marsh wrote:

mail($_REQUE ST['recipient']

SPAMMER!
Why do you say that?

http://tinyurl.com/365y5x

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Yes, that makes it a bad script.
But it does not make him a spammer.

Or maybe I am not understanding your cryptic replies, add a few more
words to make your point clearer.

FFMG
--

'webmaster forum' (http://www.httppoint.com) | 'webmaster Directory'
(http://www.webhostshunter.com/) | 'Recreation Vehicle insurance'
(http://www.insurance-owl.com/other/car_rec.php)
'Free URL redirection service' (http://urlkick.com/)
------------------------------------------------------------------------
FFMG's Profile: http://www.httppoint.com/member.php?userid=580
View this thread: http://www.httppoint.com/showthread.php?t=13789

Message Posted via the webmaster forum http://www.httppoint.com, (Ad revenue sharing).

Apr 11 '07 #10

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

Similar topics

4
1415
by: wayne | last post by:
I have a PHP email script running on two separate websites. Today, I received a form mail generated by the script from each site, with time stamps 10 minutes apart. The entered email address in each form is the same, but the REMOTE_ADDR reported is different. Doing a search of the IP Addresses generates many hits, the user apparently posts to many news groups. The postal address entered is in MA while the IP Address from the first...
9
2208
by: Jerim79 | last post by:
I am no PHP programmer. At my current job I made it known that I was no PHP programmer during the interview. Still they have given me a script to write with the understanding that it will take me a while (This information is just for general knowledge as I don't want anyone thinking I am trying to be dishonest with my intentions. Also, I do not portray myself as something I am not. I am a beginner.) Anyway, what the script needs to do is...
14
8786
by: nsamad | last post by:
Hi All, Is there anyone using python script to programm the Telit GM862-GPS module?? I am a newbie in using python. I am developing an application in which i have to open a GPRS connection and download the webpage and save in the GM862-GPS memory. I encounter a problem today which drive me crazy... I could open a connection and download the http page using AT command through hyperterminal (without python script). When i used python...
5
2719
by: ozzii | last post by:
Hi, I have a asp email script which uses cdosys to send emails with attahcments by iterating through a record set of 500 email addresses. However the script simply times out. I know you can increase the script timeout property in IIS but is there any other way of sending bulk emails with cdosys without it timing out? Any help would be greatly appreciated.
9
2403
by: Jerim79 | last post by:
Here it is: <?php if($_SERVER=='POST'){ $Number=$_POST; $Email=$_POST; $Number2=0; $error=0;
1
1264
by: harekrishna | last post by:
Hiii Can some please check my email script. I have gone through it several times but my mails won't come!! here is the script thank you- . .
2
1785
by: pravada | last post by:
Hi i am new to unix. just trying to work my things out. i have a small problem. i needed to search for a file that is created mostly first week of every month and email it to a list.... can some one please help me with a script to do so..... thanks in advance..... pradeep
0
9531
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
9345
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
10115
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9905
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
9775
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
8780
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...
0
5229
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...
0
5373
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3456
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.