Assignment045 - Send_mail
Let's send an email with PHP. To do so you will use the mail function. The mail function works with the following parameters:
mail(TO, SUBJECT, MESSAGE).
Let's breakdown each parameter. TO is the target email address. SUBJECT is what will appear in the subject line of the email. MESSAGE is the text of the email.
For example:Arrays
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>sendmail.php</title>
</head>
<body>
<?php
echo "Thank you for sending a message!";
//send feedback to Mr. C.
//variables for each parameter
$to = "brock.d.graham@gmail.com"; //this is the email
$subject = "Feedback from your Website"; //this is the subject line
$message="Chagoyan, I think you should gives us all good grades in this class."; //this is the message
//send the email (so simple!)
mail($to, $subject, $message) or print "**Message Not Sent - ABORTED! ABORTED! ABORTED! ABORTED!";
?>
</body>
</html>