Translate

<?php
require_once "Mail.php";
$from = "sddiki123@gmail.com";
$to ="syeddak123@gmail.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
 $headers =
  array (
   'From' => $from,
   'To' => $to,
   'Subject' => $subject
        );
  $smtp = Mail::factory('smtp',
   array (
     'host' => "ssl://smtp.gmail.com",
     'port' => "465",
     'auth' => true,
     'username' => "syeddak123@gmail.com",
     'password' => "syed1234"
    )
                        );
 $mail = $smtp->send($to, $headers, $body);
 if (PEAR::isError($mail)) {
   echo("<p>" . $mail->getMessage() . "</p>");
  } else {
   echo("<p>Message successfully sent!</p>");
  }
 ?>

No comments:

Post a Comment