0% found this document useful (0 votes)
17 views1 page

Mail

This document provides a step-by-step guide for installing and configuring PHPMailer on a Windows Server for sending emails using PHP. It includes instructions for creating an 'includes' folder, updating the php.ini file with the correct sendmail_path, and using the PHPMailer class in a script to send emails via SMTP. The example code demonstrates how to set up the mail parameters and send an email using Gmail's SMTP server.

Uploaded by

www.vmlrgvn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views1 page

Mail

This document provides a step-by-step guide for installing and configuring PHPMailer on a Windows Server for sending emails using PHP. It includes instructions for creating an 'includes' folder, updating the php.ini file with the correct sendmail_path, and using the PHPMailer class in a script to send emails via SMTP. The example code demonstrates how to set up the mail parameters and send an email using Gmail's SMTP server.

Uploaded by

www.vmlrgvn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

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!!";

You might also like