You are here: Re: Can anyone see a problem with this email script? « PHP Programming Language « IT news, forums, messages
Re: Can anyone see a problem with this email script?

Posted by Pete Marsh on 04/09/07 23:44

On Apr 9, 2:34 pm, Rami Elomaa <rami.elo...@gmail.com> wrote:
> 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_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...@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.

 

Navigation:

[Reply to this 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

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