I tried the formmail.php script available online, but keep getting
the error "You are coming from an unauthorized domain.". This is an
error message generated directly by the PHP script, not the server.

The formmail.php script allows you to enter an array of referers to
avoid this error, but even when I include my domain in there I still
get this error. Could it be that my webhost does not allow this
script to be run?

Otherwise this script seems to do everything I want it to do so I
would love to be able to begin using it.

Any help would be appreciated.



--- In [email protected], James Keeline <[EMAIL PROTECTED]> wrote:
>
> --- jipsy1234 <[EMAIL PROTECTED]> wrote:
>
> > I need a very simple script that will take the contents of an
online
> > form and email the form fields to a designated email address.
> >
> > Hopefully it will be portable and not require any changes when
the form
> > fields change.
>
> Have you already determined that your PHP server can successfully
send email?
>
> If you want a PHP equivalent to the Perl script formmail.pl then
Google for formmail.php and you
> will see many links.  The Perl/PHP formmail implements required
fields and a number of other
> features which may be desirable.
>
> I'm not a big fan of sending emails with a bunch of variable=value
pairs.  You have to do
> something with the data.  Isn't it usually better to put it in a
database where you can access the
> info with greater flexibility?
>
> However, that said, you could do something simple like this:
>
> $to    = "[EMAIL PROTECTED]";
> $subj  = "Some form data just came in";
> $from  = "From: [EMAIL PROTECTED]";
> $body  = print_r($_POST, true);
> mail($to, $subj, $body, $from);
>
> It is possible (even likely) that the print_r() function uses
newlines.  Since email is supposed
> to have \r\n pairs at the end of each line, you might have to use a
regular _expression_ to fix this
> (unless there is a PHP function I don't know which can fix the line
endings).
>
> James
> _____
>
>
> James D. Keeline
> http://www.Keeline.com  http://www.Keeline.com/articles
> http://Stratemeyer.org  http://www.Keeline.com/TSCollection
>
> http://www.ITeachPHP.com -- Free Computer Classes: Linux, PHP, etc.
> Spring Semester January-June 2006.  Two new class topics.
>






Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list




YAHOO! GROUPS LINKS




Reply via email to