Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require('phpmailer/PHPMailerAutoload.php');
- require('phpmailer/class.phpmailer.php');
- require('phpmailer/class.smtp.php');
- require('phpmailer/class.pop3.php');
- $to = "thiago.falcao@methodinformatica.com.br"; // this is your Email address
- $name = $_POST['nmContato'];
- $from = $_POST['email']; // this is the sender's Email address
- $subject = $_POST['assunto'];
- $message = $name . " enviou a mensagem:" . "nn" . $_POST['txt_contato'];
- $mail = new PHPMailer();
- $mail->IsSMTP();
- $mail->CharSet="UTF-8";
- $mail->Debugoutput = 'html';
- $mail->Host = 'email-ssl.com.br';
- $mail->Port = 465;
- $mail->SMTPSecure = 'ssl';
- $mail->SMTPAuth = true;
- $mail->IsHTML(true);
- $mail->Username = 'thiago.falcao@methodinformatica.com.br';
- $mail->Password = 'senhadoemail';
- $mail->From = $from; //o erro ocorre quando esse valor é thiago.friedman@hotmail.com
- $mail->FromName = $name;
- $mail->AddAddress($to);
- $mail->Subject = $subject;
- $mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
- $mail->Body = $message;
- $mail->SMTPDebug = 1;
- if(!$mail->Send()){
- echo 'Mailer Error: ' . $mail->ErrorInfo;
- }else{
- echo 'Message has been sent';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement