Current Path : /var/www/html/
Upload File :
Current File : /var/www/html/smtp_mail.php

<?php
  include_once "Mail.php"; //die('hello');
  $from = "365 Hops <info@365hops.com>";
 $to = "Raj Verma <rajkumar3883@gmail.com>";
 $subject = "Hi!";
 $body = "Hi,\n\nHow are you?";
 
 $host = 'smtp.live.com';//"smtp-mail.outlook.com";
 $username = "info@365hops.com"; 
 $password = "humtum123";
 
 $headers = array ('From' => $from,
   'To' => $to,
   'Subject' => $subject);
 $smtp = Mail::factory('smtp',
   array ('host' => $host,
     'auth' => true,
     'username' => $username,
     'password' => $password));
 
 $mail = $smtp->send($to, $headers, $body);
 
 if (PEAR::isError($mail)) {
   echo("<p>" . $mail->getMessage() . "</p>");
  } else {
   echo("<p>Message successfully sent!</p>");
  }
 ?>

,