How to send email with custom body by PHP

If you want to send email with custom body by PHP, follow these steps:

Use the following code in your PHP support code file:

$recipient = "[email protected]"; //recipient 
$email = ($_POST['email']); //senders e-mail adress 

$Name = ($_POST['name']); //senders name 

$mail_body  = "Hello, \r\n";
$mail_body .= "You have received a new booking with the following details: \r\n";
$mail_body .= "Booking Time: ({$_POST['time']}) Booking Date: ({$_POST['date']}) \r\n";
$mail_body .= "Additional customer comments: ({$_POST['comments']}); \r\n";
$mail_body .= "Please respond to the customer within 30 minutes on the following phone number: ({$_POST['phone']}) \r\n";
$mail_body .= "Warm regards, \r\n";
$mail_body .= "Robot. \r\n";



$subject = "Porter Inquiry"; //subject 
$header = "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields 

mail($recipient, $subject, $mail_body, $header); //mail command :) 

How to send email with custom body by PHPexpoundsofttechsolution

ghb