Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to send Email using PHP with MySQL in Linux Server?..

Answer Posted / karthi

PHP Code
The PHP code to send email is simply one PHP function mail
() . The basic format for this function is:
mail("to", "subject", "message");

For example (this is straight out of the online help that
comes with PHP):
mail("joecool@example.com", "My Subject", "Line 1\nLine 2
\nLine 3");
PHP does need to be installed and setup properly for mail
to work. On a Unix-type setup, such as Linux, PHP will use
your local sendmail program to send it. Windows machines
use SMTP. If you need to you can edit your php.ini file and
set the appropiate SMTP host you use to send email.
Here's the code to send the email:
if ($REQUEST_METHOD == "POST") {
// Just to be on the safe side - I'll strip out HTML tags
// (scripting code may mess with some email clients)
$realname = strip_tags($realname);
$email = strip_tags($email);
$feedback = strip_tags($feedback);
// setup variables
$sendto = "$email";
$subject = "Send Mail Feedback Using PHP";
$message = "$realname, $email\n\n$feedback";
// send email
mail($sendto, $subject, $message);
}
?>

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is Type hinting in PHP?

1148


How do I install php and apache on windows 10?

1071


What are the string functions in php?

970


How to remove the new line character from the end of a text line?

994


Which is not a php magic constant?

1067


What are the __construct() and __destruct() methods in a php class?

954


What are the differences between PHP3 and PHP4 and PHP5? what is the current stable version of PHP?

1118


Tell us what does $_cookie means?

996


Is time a dependent variable?

986


How do I use isdigit function?

1065


How do I get csrf token?

968


What is echo and print in php?

964


How do you trim spaces in excel?

1024


What is the difference between $name and $$name?

1007


What is php programming used for?

1000