Skip to content

Instantly share code, notes, and snippets.

@filipecrosk
Created August 30, 2013 12:11
Show Gist options
  • Save filipecrosk/6389227 to your computer and use it in GitHub Desktop.
Save filipecrosk/6389227 to your computer and use it in GitHub Desktop.
<?php
require 'class.phpmailer.php';
//chama a classe de envio de email e define config inicial
$mail = new PHPMailer();
$mail->CharSet = "UTF-8";
$mail->IsSMTP();
$mail->Host = "plantaosexy-mail.com";
$mail->SMTPAuth = true;
$mail->Port = 587;
$mail->Username = "contato";
$mail->Password = "5338e74dc";
$remetente = "contato@plantaosexy-mail.com";
$mail->SetFrom($remetente,"PlantãoSexy");
$mail->AddAddress('filipe@primeiroestilo.com.br');
$mail->Subject = "Teste";
$mail->MsgHTML("Teste de envio de email");
$mail->IsHTML(true);
if(!$mail->Send()) {
?>
<script>
alert("Erro no envio: <?=$mail->ErrorInfo;?>");
</script>
<?
} else {
?>
<script>
alert("E-mail enviado com sucesso.");
</script>
<?
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment