<?php
/* This is called by pearEmailTest.htm -- it is simple test that the pear email (with plain
   authentication) is working
   You should change the various fields below (such as the username and password)
*/

include("Mail.php");
/* mail setup recipients, subject etc */
$recipients = "toYou@wherever.com";
$headers["From"] = "admin@mysite..net";
$headers["To"] = "toYou@wherever.com";
$headers["Subject"] = "Subject line";
$mailmsg = "Hello, This is a test2 \n Goodbye..";
/* SMTP server name, port, user/passwd */
$smtpinfo["host"] = "smtp.yourmailprovider.com";
$smtpinfo["port"] = "587";  // or "25"
$smtpinfo["auth"] = true;
$smtpinfo["username"] = "username";
$smtpinfo["password"] = "password";
/* Create the mail object using the Mail::factory method */
$mail_object =& Mail::factory("smtp", $smtpinfo);
/* Ok send mail */
$mail_object->send($recipients, $headers, $mailmsg);
 if (PEAR::isError($mail_object)) {
   echo("<p>" . $mail->getMessage() . "</p>");
  } else {
   echo("<p>Message successfully sent!</p>");
  }

?>
