Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $nome = $_POST['nome'];
- $email_usuario = $_POST['email'];
- $assunto = $_POST['assunto'];
- $mensagem = $_POST['msg'];
- $tipo_mensagem = isset($_POST['tipo_msg']) ? $_POST['tipo_msg'] : "";
- require '../model/PHPMailer/PHPMailerAutoload.php';
- $mail = new PHPMailer(true); // Passing `true` enables exceptions
- try {
- $mail->IsSMTP();
- $mail->CharSet="UTF-8";
- $mail->Debugoutput = 'html';
- $mail->SMTPDebug = 2; // Enable verbose debug output // Set mailer to use SMTP
- $mail->Host = 'smtp.umbler.com'; // Specify main and backup SMTP servers
- $mail->Port = 587;
- $mail->SMTPAuth = true;
- $mail->IsHTML(true);
- $mail->Username = 'meuemail@umbler.com'; // SMTP username
- $mail->Password = 'minhasenha'; // SMTP password
- $mail->AddReplyTo($email_usuario, $nome); //AQUI vai o reply-to:
- $mail->AddAddress('meuemail@umbler.com');
- $mail->Subject = $assunto;
- $mail->Body = '<h3>Mensagem: '.$tipo_mensagem.' '.$mensagem.'</h3>';
- $mail->send();
- return 'Message has been sent';
- } catch (Exception $e) {
- return 'Message could not be sent. Mailer Error: '.$mail->ErrorInfo;
- }
Add Comment
Please, Sign In to add comment