Wrox Programmer Forums
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 18th, 2007, 12:18 PM
Registered User
 
Join Date: Jun 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to fawahb
Default Form To Mail

hello Group,
Please i want to create a form to mail script i have created but it keep giving me errors
please help me out
[email protected]



A.Ayeloja
 
Old July 23rd, 2007, 03:33 PM
Authorized User
 
Join Date: Sep 2006
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try this:

Code:
<form acion="thisfile.php" method="post">
<p>subject<p>
<input type="text" name="subject" />
<p>From</p>
<input type="text" name="from" />
<p>Body</p>
<textarea rows="50" cols="70" name="body" />
<input type="submit" value="send email" />

<?php

$subj = $_POST['subject'];
$to = "[email protected]";
$body = $_POST['body'];
$from = $_POST['from'];

mail($to, $subj, $body, $from);
?>
I think this is what you want, hopefully it works.

"Judge a man by his questions, not by his answers."
-Voltaire





Similar Threads
Thread Thread Starter Forum Replies Last Post
Form Web Mail asters ASP.NET 1.0 and 1.1 Basics 1 July 17th, 2008 05:52 AM
send e-mail form but.. Dejitan Classic ASP Basics 1 January 4th, 2007 06:09 AM
Form mail validation plexus PHP How-To 0 April 14th, 2006 05:58 AM
Web mail form MDM ASP.NET 2.0 Basics 0 March 20th, 2006 10:22 AM
E-mail HTML Form rdmapes Beginning PHP 4 December 18th, 2003 12:32 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.