phpmailer send html code example
Example: phpmailer example php
<?php
require_once('class.phpmailer.php');
$mailer = new PHPMailer();
$mailer->IsSMTP();
$mailer->SMTPDebug = 1;
$mailer->Port = 587;
$mailer->Host = 'smtplw.com.br';
$mailer->SMTPAuth = true;
$mailer->Username = 'smtplocaweb';
$mailer->Password = 'Gwb9etA323';
$mailer->FromName = 'Bart S. Locaweb';
$mailer->From = '[email protected]';
a mesma caixa postal configurada no remetente do SMTP
$mailer->AddAddress('[email protected]','Nome do
destinatário');
$mailer->Subject = 'Teste enviado através do PHP Mailer
SMTPLW';
$mailer->Body = 'Este é um teste realizado com o PHP Mailer
SMTPLW';
if(!$mailer->Send())
{
echo "Message was not sent";
echo "Mailer Error: " . $mailer->ErrorInfo; exit; }
print "E-mail enviado!"
?>