<?php
// rem out AFTER you get this test script to work
error_reporting(E_ALL);
// test of x10hosting's free-hosting mail system using PHP mail() fuction
// You can send to more than one address like --> "myname@gmail.com, myname@hotmail.com, myname@myphone.com"
// replace inside the quote marks
$to_email = "TO ADDRESS";
// The [ From: ] address must be a valid Email address in your x10hosting's free-hosting account
// replace inside the quote marks
$from_email = "FROM ADDRESS";
// ****************************//
// DO NOT EDIT BELOW THIS LINE //
if (($from_email == "FROM ADDRESS") || ($to_email == "TO ADDRESS"))
{
print "You need to set the TO: and FROM: address before you run this test script<br>\n";
EXIT;
}
// we use a timestamp do to the long delay - sometimes days - to receive this test Email
$timestamp_server = date("D M j,Y H:i:s T",time());
$subject = "Test of PHP mail() at server time " . $timestamp_server;
$mailbody = "Test message sent at server time\n" . $timestamp_server;
$headers = 'Content-type: text/plain; charset=\"iso-8859-1\"' . "\r\n";
$headers .= 'From: ' . $from_email . "\r\n";
// send a copy back - for backup - if you do not receive this test Email at your [ TO ADDRESS ]
// look for it with your Email client or Webmail in cPanel - at your [ FROM ADDRESS ]
$headers .= 'Cc: ' . $from_email . "\r\n";
$headers .= 'Reply-To: ' . $from_email . "\r\n";
$headers .= 'Return-Path: ' . $from_email . "\r\n";
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'X-Mailer: PHP/' . phpversion() . "\r\n";
print "PHP function [ mail() ] returns TRUE if the mail was successfully accepted for delivery, FALSE otherwise<br>\n";
print "It is important to note that just because the mail was accepted for delivery<br>\n";
print "it does NOT mean the mail will actually reach the intended destination<br>\n";
print "your x10hosting account may have a spam filter that bocks it or the destination account may block it<br>\n<br>\n";
if(mail($to_email,$subject,$mailbody,$headers))
{
print "PHP mail() returned TRUE<br>\n";
}
else
{
print "ERROR sending Email PHP mail() returned FALSE<br>\n";
}
print 'Server date and time ' . $timestamp_server . "<br>\n";
exit(); // to be sure we are done
?>