Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- $nome = $_POST["nome-contato"];
- $email = $_POST["email-contato"];
- $mensagem = $_POST["mensagem-contato"];
- require_once("mailer/mail-autoloader.php");
- $mail = new PHPMailer();
- $mail->isSMTP();
- $mail->Host = 'smtp.gmail.com';
- $mail->Port = 587;
- $mail->SMTPSecure = 'tls';
- $mail->SMTPAuth = true;
- $mail->Username = "gamboamurilo@gmail.com";
- $mail->Password = "Necro145";
- $mail->setFrom("gamboamurilo@gmail.com", "Murilo Henrique");
- $mail->addAddress("gamboamurilo@gmail.com");
- $mail->Subject("Email de contato da Nargloth Store");
- $mail->msgHTML("<html> de: {$email} <br/> nome: {$nome} <br/><br/> {$mensagem}</html>");
- $mail->AltBody = "de: {$email}nnome: {$nome}nn{$mensagem}";
- if ($mail->send()) {
- $_SESSION["success"] = "E-mail enviado com sucesso";
- header("Location: index.php");
- }else{
- $_SESSION["error"] = "Devido a um erro, o seu email não foi enviado" . $mail->ErrorInfo;
- header("Location: contato.php");
- }
- die();
- ( ! ) Fatal error: Call to undefined method PHPMailer::Subject() in C:wamp64wwwphpIenvia-contato.php on line 20
- Call Stack
- # Time Memory Function Location
- 1 0.0000 249064 {main}( ) ...envia-contato.php:0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement