<?php
include('includes/header.php');
error_reporting(E_ALL);
echo("<h1>Kaylyn's code for standard email:</h1>");
// use YOUR to/from email addresses
$mail_sent = '';
// use your student email address
// $to = 'sperlt@mail.lcc.edu';
$subject = 'Subject';
$from_address = 'your@mail.lcc.edu';
$from_name = 'YOUR NAME';
$body = "This is from a more complicated mail script!\n";
$subject = "More complicated mail (CITW)";
$eol="\r\n";
$headers = "From: ".$from_name."<".$from_address.">" . $eol;
$headers .= "Reply-To: ".$from_name."<".$from_address.">" . $eol;
$headers .= "Return-Path: ".$from_name."<".$from_address.">" . $eol;
$headers .= "Message-ID: <".time()."-".$from_address.">" . $eol;
$headers .= "X-Mailer: PHP v".phpversion() . $eol;
// HTML Version
$headers .= "Content-Type: text/html; charset=utf-8" . $eol;
$headers .= "Content-Transfer-Encoding: 8bit". $eol . $eol;
$message = $body . $eol . $eol;
ini_set('sendmail_from', $from_address);
// uncomment the below statement for this to work
// $mail_sent = mail($to, $subject, $message, $headers);
ini_restore('sendmail_from');
if($mail_sent)
{
echo("Successfully sent an email to: $to");
}
else
{
echo('Sending email failed.');
}
include('includes/footer.php');
?>