https://github.
com/ladybirdweb/faveo-helpdesk/wiki/Install-and-configure-a-simple-
mail-server-for-sending-mails-using-PHP-mail-function-in-Faveo-on-Centos-7-server
Install PHPMailer on Windows Server
PHPMailer is simple enough to use but in windows server you may face problem.
because it is not same as we do.Check the following steps
1. Make a new folder 'includes' in your PHP installation folder.
Example (c:\php\includes)
2. You just need to upload PHPMailer class folder inside the 'includes' folder.
Example C:\php\includes\PHPMailer
3. Add this include path in your php.ini . commencement sendmail_path and use the
path
Example sendmail_path ="C:\php\includes\PHPMailer\HPMailerAutoload.php"
So in php.ini file it will look like
[mail function]
; For Win32 only.
; http://php.net/smtp
;SMTP = localhost
; http://php.net/smtp-port
;smtp_port = 25
; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from =
[email protected]; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path ="C:\php-5.5.14\include\PHPMailer\PHPMailerAutoload.php"
4. Also keep PHPMailer class folder in your root directory. use the class
Example
require 'class/PHPMailer/PHPMailerAutoload.php';
$from = "[email protected]";
$mail = new PHPMailer();
$mail->IsSMTP(true); // use SMTP
$mail->IsHTML(true);
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Host = "smtp.gmail.com"; // SMTP host here use gmail
$mail->Port = 465; // set the SMTP port
$mail->Username = "[email protected]"; // SMTP username
$mail->Password = 'ur gmail pass'; // SMTP password
$mail->SMTPSecure = 'ssl';
$mail->SetFrom($from, 'Support Test');
$mail->AddReplyTo($from,'Support Test');
$mail->Subject = $subject;
$mail->MsgHTML($body);
$mail->AddAddress($to, $to_name);
if($mail->Send())
{
echo "mail sent!!";
}
else
echo "mail not sent!!";