2
I am using the following code to send email:
<?php
require 'libs/PHPMailerAutoload.php';
$mailer = new PHPMailer();
$mailer ->isSMTP();
$mailer ->isHTML(true);
$mailer->CharSet = "UTF-8";
$mailer->SMTPAuth = true;
$mailer->SMTPSecure = "tls";
$mailer->Host = "smtp.live.com";
$mailer->Port = 587;
$mailer->Username = "[email protected]";
$mailer->Password = "*********";
$mailer->From = "[email protected]";
$mailer->FromName = "leonardo vialrinho";
$mailer->Subject = "TESTE DE EMAIL";
$mailer->Body = "body HTML";
$mailer->AltBody = "body texto";
$mailer->addAddress("[email protected]");
if($mailer -> send()) {
echo "Enviado";
} else {
echo "Erro: ".$mailer->ErrorInfo;
}
?>
So far no problem, but how would it be in a contact form? Where the user will not enter the password of email
of him. And I don’t even think it’s cool for me to put my password email
in the code (in case it was to send a registration confirmation, etc)