03-11-2008, 12:37 PM
|
#5 (permalink)
|
|
The Visitor
Join Date: Mar 2008
Posts: 4
Thanks: 2
|
Thanks Alan, I have mail form, where user will send mail to me,(mail, name, subjet, body...). So I want to take data with post method in controller and send email. I will send code that I want to use with Zend Framework.
<html>
<body>
Code:
<?php
if (isset($_REQUEST['email']))
//if "email" is filled out, send email
{
//send email
$email = $_REQUEST['email'] ;
$subject = $_REQUEST['subject'] ;
$message = $_REQUEST['message'] ;
mail( "krum@example.com", "Subject: $subject",
$message, "From: $email" );
echo "Your email is send";
}
else
//if "email" is not filled out, display the form
{
echo "<form method='post' action='mailform.php'>
Email: <input name='email' type='text' /><br />
Subject: <input name='subject' type='text' /><br />
Message:<br />
<textarea name='message' rows='15' cols='40'>
</textarea><br />
<input type='submit' />
</form>";
}
?>
</body>
</html>
Last edited by Wildhoney : 03-11-2008 at 03:13 PM.
|
|
|
|