<?php
function Send_Mail($to,$subject,$body)
{
require 'class.phpmailer.php';
$from = "from@yourwebsite.com";
$mail = new PHPMailer();
$mail->IsSMTP(true);
$mail->IsHTML(true);
$mail->SMTPAuth = true;
$mail->Host = "tls://smtp.yourwebsite.com";
$mail->Port = 465;
$mail->Username = "SMTP_Username";
$mail->Password = "SMTP_Password";
$mail->SetFrom($from, 'From Name');
$mail->AddReplyTo($from,'From Name');
$mail->Subject = $subject;
$mail->MsgHTML($body);
$address = $to;
$mail->AddAddress($address, $to);
$mail->Send();
}
?>
для отправки почты с локального сервера