Home > PHP > How to send email through php ?

How to send email through php ?

October 8th, 2009

Send email using the PHP mail() function

Description
How to send an email from within a PHP page using the built in mail() function.
The code

<?php

// Your email address
$email = “you@example.com”;

// The subject
$subject = “Enter your subject here”;

// The message
$message = “Enter your message here”;

mail($email, $subject, $message, “From: $email”);

echo “The email has been sent.”;

?>

PHP

  1. No comments yet.
  1. No trackbacks yet.