Home » Categories » PHP » PHPMailer

PHPMailer send mail class

/*
$mail = new PHPMailer(); // defaults to using php "mail()"
$mail->CharSet = 'UTF-8';

//---Setting SMTP ---

$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = 'smtp.gmail.com'; // SMTP server

$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = 'tls'; // enable SMTP TLS connection
$mail->Port = 465; // set the SMTP port for the GMAIL server
$mail->Username = '[email protected]'; // SMTP account username
$mail->Password = 'ThePassword'; // SMTP account password

//--- Ending Smtp Settings

$mail->From = '[email protected]';
$mail->FromName = 'Datikan 224';

$To = '[email protected]';
$ToName = 'Saeed Nobakht';

$mail->AddAddress(strtolower($To), $ToName);

$mail->Subject = 'test';
$mail->MsgHTML('xxx zzz cccc');
if(!$mail->Send()) {

echo("Mailer Error: " . $mail->ErrorInfo);

}
*/

Article Rating (No Votes)
Rate this article
  • Icon PDFExport to PDF
  • Icon MS-WordExport to MS Word
 
Attachments (1) Attachments
Comments Comments
There are no comments for this article. Be the first to post a comment.
Related Articles RSS Feed
There are no related articles for this article.