Reply to Re: Can anyone see a problem with this email script?

Your name:

Reply:


Posted by Rami Elomaa on 04/09/07 21:34

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.='Content-type: text/html; charset=iso-8859-1';
> $message='';
> while ($field = current($_REQUEST)) {
> if ((key($_REQUEST)!="Your_Name:") && (key($_REQUEST)!
> ="Your_Email:") && (key($_REQUEST)!="Message:") && (key($_REQUEST)!
> ="i")) {
> $message.="<strong>".key($_REQUEST)."</strong>&nbsp;&nbsp;&nbsp;".
> $field."<br>";
> }
> next($_REQUEST);
> }
> $message.="<br>".$_REQUEST['Message:'];
> mail($_REQUEST['recipient'], $subject, "
> <html>
> <head>
> <title>Contact 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_email@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.Elomaa@gmail.com
"Olemme apinoiden planeetalla."

[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

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