Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once 'PHPMailer/PHPMailerAutoload.php';
- $mail = new PHPMailer();
- $mail->IsSMTP();
- $mail->Host = 'host aqui';
- $mail->Port = 587;
- $mail->SMTPAuth = true;
- $mail->IsHTML(true);
- $mail->Username = 'emailr';
- $mail->Password = 'senha';
- $mail->SMTPSecure = false; //Diz que nao tem tls/ssl
- $mail->SMTPAutoTLS = false; //Diz que nao tem tls/ssl
- $mail->SMTPDebug = 2; //Mostra os bugs
- //E-mail remetente (deve ser igual ao que esta enviando)
- $mail->From = 'email';
- //Nome do remetente
- $mail->FromName ='Lojas';
- //Assunto da mensagem
- $mail->Subject = 'Texto';
- //Corpo da mensagem
- $mail->Body = 'Ola';
- //Corpo da mensagem em texto
- $mail->AltBody = 'Conteudo do e-mail em texto';
- //Destinatario
- $mail->AddAddress ('exemplo@email');
- if ($mail->Send()) {
- echo "e-mail enviado com sucesso";
- echo'<script> alert("Cadastro realizado com sucesso!")</script>';
- }else{
- echo "Erro no envio do e-mail" .$mail->ErrorInfo;
- }
- ?>
Add Comment
Please, Sign In to add comment