A way to test if email is working with PHP install

The following can be copied into a file and then served to a web browser and executed. If email is correctly configured it will send an email message.

<?php
/* SENDER */
$from='you@yourdomain.com';

/* RECIPIENT */
$to='test@yourdomain.com';

/* DO NOT EDIT BELOW */
$headers="From: $from\n";
$headers.="Reply-to: $from\n";
mail($to,'Test message','E-mail test successfull',$headers);

?>
<html>

<head>
<title>E-mail test</title>
</head>

<body>

<p>E-mail sent...</p>

</body>

</html>
---------------------------
If this does not work, please see
and be sure to install within PEAR:
b. pear install -a MAIL-1.2.0
c. pear install -a Mail_Mime-1.6.0

Also, see for more details on PHP installation:
http://www.jargonsoft.com/support/knowledgebase.php?article=1

Article Details

Article ID:
20
Category:
Date added:
2010-12-20 17:44:16
Views:
1,076
Rating (Votes):
(648)