Hi
Trying to send an e-mail via SMTP, its not working, any help?
//SMTP info
$host = "smtp.gmail.com";
$username = "[email protected]";
$password = "password";
$from = "Taylor";//From email address
$to = "[email protected]";//Change this to your inbox
$headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject);
// HTML email
//$headers .= "MIME-Version: 1.0" . "\r\n";
//$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$smtp = Mail::factory('smtp', array ('host' => $host, 'auth' => true, 'username' => $username, 'password' => $password));
//Send to you
$mail = $smtp->send($to, $headers, $message);
if (PEAR::isError($mail)) {
echo("<h1>** Whoops! Error!. **</h1> <p>Please call us instead.</p>");
echo("<p>" . $mail->getMessage() . "</p>");
} else {
echo("<h1>Thank you for your inquiry!</h1> <p>Thank you for signing up for our event. Your request for our guestlist has been received. Please check your email for the confirmation.</p> ");
}