NYCPHP Meetup

NYPHP.org

[nycphp-talk] PHP AND EMAIL

Saima Mazhar salmaz2000 at gmail.com
Wed Dec 28 13:00:52 EST 2005


Thanks Ken. I`ll definitely try this out. Looks very helpful. Thanks again.

Salman.


On 12/28/05, Ken Robinson <kenrbnsn at rbnsn.com> wrote:
>
> Quoting Saima Mazhar <salmaz2000 at gmail.com>:
>
> > Hello,
> >
> > I am creating an order form in HTML on a Linux machine. I would like to
> > fetch all or some of the fields from that form and put them in an email
> and
> > send the email to anyone. How can I do that? Is there an email feature
> in
> > PHP? If there is such a feature, then is it supported by all the
> versions of
> > PHP and where can I find some examples of this?
>
> There is the mail() function in PHP
> <http://www.php.net/manual/en/function.mail.php>
>
> This is a simple script to mail the contents of your form back to
> yourself would
> be:
>
> <?php
>   $to = 'youremail at your.domain.com';
>   $subject = 'Order form contents';
>   $headers = 'From: orderform at your.domain.com';
>   $body = print_r($_POST,true); // assumes that you are using the POST
> method
>   mail($to, $subject, $body, $headers);
> ?>
>
> I have no error checking in the script and I haven't checked it for syntax
> errors.
>
> Ken
>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20051228/fbb9f16a/attachment.html>


More information about the talk mailing list