What is the syntax to send a mail in PHP

What is the syntax to send a mail in PHP.

Try checking the manual. Write some code and if you have a problem come back and post your code for some help.

There are many free PHP form to email scripts available online, so you could google that as well.

You could use something like this:


mail($to, $subject, $message, $headers);

where $header is a "\r
" separated list of string segments such as: "From: webmaster@example.com \r
Reply-To: webmaster@example.com \r
"

Do keep in mind that mail() requires that you actually have host permission for this… so testing in a local PHP install environment is not a good idea.

Use this code in Php section
<?php
$to = “someone@example.com”;
$subject = “Test mail”;
$message = “Hello! This is a simple email message.”;
$from = “someonelse@example.com”;
$headers = “From:” . $from;
mail($to,$subject,$message,$headers);
echo “Mail Sent.”;
?>

Basic syntax for sending mail in php

mail(“to”,“subject”,“message”,[headers]);