Sample script in sending email via PHP

Mail function allows your website to automatically send emails like an auto response to customers or website viewers. This is done through sending email via php script. You may try the example below. Please replace all the necessary information to the correct ones.

Sending email via PHP script

phpmailer.php

<?php

$to = “someone@example.com,someother@example.com”;

$subject = “Test mail”;

$message = “Hello! This is a test email message.”;

$from = “someonelse@example.com”;

$headers = “From:” . $from;

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

echo “Mail Sent.”;

?>

If you are sending through an external server, you may see Mailing Script with External Server. Please do not hesitate to contact our support team if you have further questions.

sending email via PHP

(Visited 171 times, 1 visits today)