Send email with a template using php
To send an email using PHP, you can use the "mail()" function. Here is an example of a basic email template:
<?php
$to = "recipient@example.com";
$subject = "Test Email";
$message = "This is a test email sent using PHP.";
$headers = "From: Sender <sender@example.com>\r\n";
mail($to, $subject, $message, $headers);
?>
In this example, an email is sent to the address "recipient@example.com" with the subject "Test Email" and the message text "This is a test email sent using PHP." The "From" header is set to "Sender sender@example.com".
Note: The mail() function uses the local Mail Transfer Agent (MTA) on the server where the PHP script is running to send the email. Therefore, a configured MTA must be present on the server for the email to be sent successfully.