Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
I want to send Email to the users from my PHP page.
There should be a "to" textbox
"subject" text box
"Message" text box.

I don't know what coding will be appropiate for this task.
My other pages are ready only not able to create this page.

This not my home task. Its a Project of a hotel. Where I want to send email to the visitors, to their email address.

please help me
Posted
Comments
Sergey Alexandrovich Kryukov 3-Mar-12 21:03pm    
Have you been banned by Bing? Too bad, try Goodle... What, Google, too?
--SA

Google is your friend: Be nice and visit him often. He can answer questions a lot more quickly than posting them here...

A very quick search using your subject as the search term gave nearly 300,000,000 hits:

http://www.google.co.uk/search?ix=sea&sourceid=chrome&ie=UTF-8&q=send+email+from+PHP[^]

In future, please try to do at least basic research yourself, and not waste your time or ours.
 
Share this answer
 
Comments
Uday P.Singh 5-Mar-12 2:58am    
5!
Here:
http://php.net/manual/en/function.mail.php[^].

I also want to warn you against a usual mistake which can make your side an easy prey of malicious artists. Please see my past answer:
unable to send mail , it showing the error in below code .[^].

—SA
 
Share this answer
 
Comments
Uday P.Singh 5-Mar-12 2:58am    
5!
Sergey Alexandrovich Kryukov 5-Mar-12 3:17am    
Thank you, Uday.
--SA
PHP
<?php
$a=$_POST['a']; textbox 1 name
$b=$_POST['b']; textbox 2 email
$c=$_POST['c']; textbox 3 idea
$toaddress='roy_colman2003@yahoo.com';
$fromaddress='from:'.$b;

if (!eregi('^[a-zA-Z0-9_\-\.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$', $b))
{
echo 'success';
exit;
}




mail($toaddress,$a,$c,$fromaddress);


?>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900