Jump to content
  • ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

  • Similar Content

    • By Chirlison
      Olá a todos!
      Estou utilizando a biblioteca phpmailer para enviar emails autenticados através do formulário de contato do meu site.
      O problema é que o remetente da mensagem aparece sendo meu próprio email.
      Eu gostaria de saber se é possível alguém enviar um email preenchido pelo formulário de contato no site e chegasse na minha caixa de e-mail como remetente o email do usuário que preencheu o formulário de contato no site e não o email de autenticação?
      Desde já, agradeço a todos que puderem ajudar!
    • By analuciagpontes
      Galera...
      Tenho uma hospedagem no Hostgator e quero fazer um phpmailer.... Só que não dá pra fazer com 2 arquivos (um em html e outro em php). Como faço para chamar a função no form action?
      Envio abaixo o código que está sendo usado.
       
      <html>
      <head>
      <title>Formulario Fale conosco</title>
      <style>
      body { padding: 50px 100px; font-size: 13px; font-family: arial, Tahoma, sans-serif; }
       a { color:#000; } h2 { margin-bottom: 20px; color: #133141; }
      input, textarea { padding: 10px; border: 1px solid #E5E5E5; width: 200px; color: #999999; box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 8px; -moz-box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 8px; -webkit-box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 8px; }
      textarea { width: 400px; height: 150px; max-width: 400px; line-height: 18px; }
      input:hover, textarea:hover, input:focus, textarea:focus { border-color: 1px solid #C9C9C9; box-

      shadow: rgba(0, 0, 0, 0.2) 0px 0px 8px; -moz-box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 8px; -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 8px; }
      .form label { margin-bottom: 10px; color: #999999; display: block; }
      .submit input { width: 100px; height: 40px; background-color: #133141; color: #FFF; border-radius: 3px; moz-border-radius: 3px; -webkit-border-radius: 3px; }
      </style>
      </head>
      <body>

      <?php
      if (isset($_POST['BTEnvia'])){
       $function conec (mysql_connect ("XXX.hostgator.com.br","XXX", "XXX", "XXX"));{
       $nome = $_POST['nome'];
       $email = $_POST['email'];
       $telefone = $_POST['telefone'];
       $mensagem = $_POST['mensagem'];
       $email_remetente = "XXX";
       $email_destinatario = "XXX";
       $email_reply = "$email";
       $email_assunto = "Contato formmail";
       $email_conteudo = "Nome = $nome \n";
       $email_conteudo .= "Email = $email \n";
       $email_conteudo .= "Telefone = $telefone \n";
       $email_conteudo .= "Mensagem = $mensagem \n";
       $email_headers = implode ( "\n",array ( "From: $email_remetente", "Reply-To: $email_reply", "Return-Path: $email_remetente","MIME-Version: 1.0","X-Priority: 3","Content-Type: text/html; charset=UTF-8" ) );
       }
      if (mail ($email_destinatario, $email_assunto, nl2br($email_conteudo), $email_headers)){
       echo "E-Mail enviado com sucesso!";
       }
      else{
       echo "Falha no envio do E-Mail!"; }}
      ?>

       <form method="POST" action="conec()">
       <p>
       Nome:<br />
       <input type="text" size="30" name="nome">
       </p>  
       <p>
       E-mail:<br />
       <input type="text" size="30" name="email">
       </p>  
       <p>
       Telefone:<br />
       <input type="text" size="35" name="telefone">
       </p>  
       <p>
       Mensagem:<br />
       <input type="text" size="35" name="mensagem">
       </p>  
       <p>
                <input type="submit" name="BTEnvia" value="Enviar">
         <input type="reset" name="BTApaga" value="Apagar">
              </p>
      </form>
      </body>
      </html>
    • By juniormatrix
      Boa noite
       
      Gostaria de saber se posso hospedar meu site em um determinado servidor, mas usar o serviço de envio de mensagens pelo PHPMailer usando outro servidor diferente, ou seja, o arquivo PHP está num servidor, mas para realizar o envio, usa outro, é possivel?
    • By rogerblower
      Pessoal estou usando PHPMailer para enviar email com dados do formulário e ao mesmo tempo gravar no mysql.
      O email esta sendo enviado mas não esta gravando no banco, não sei onde estou errando segue meu código.
       
      <?php include 'header.php'; ?> <div class="container"> <div class="row"> <div class="col-md-12"> <div class="row"> <?php date_default_timezone_set('Etc/UTC'); if(isset($_POST['btnsave'])) { $id_cliente = $_POST['id_cliente']; $produto = $_POST['produto']; $medida = $_POST['medida']; $msg = $_POST['msg']; $qtd = $_POST['qtd']; $aprovado = $_POST['aprovado']; $status = $_POST['status']; $data_orca = date('Y-m-d'); $imgFile = $_FILES['user_image']['name']; $tmp_dir = $_FILES['user_image']['tmp_name']; $imgSize = $_FILES['user_image']['size']; if(empty($imgFile)){ $errMSG = "Please Select Image File."; } else { $upload_dir = 'imagens/orcamento/'; // upload directory $imgExt = strtolower(pathinfo($imgFile,PATHINFO_EXTENSION)); // get image extension // valid image extensions $valid_extensions = array('jpeg', 'jpg', 'png', 'gif'); // valid extensions // rename uploading image $userpic = rand(1000,1000000).".".$imgExt; // allow valid image file formats if(in_array($imgExt, $valid_extensions)){ // Check file size '5MB' if($imgSize < 5000000) { move_uploaded_file($tmp_dir,$upload_dir.$userpic); } else{ $errMSG = "Desculpe seu arquivo é muito grande."; } } else{ $errMSG = "Desculpe, somente arquivos JPG, JPEG, PNG e GIF são aceitos."; } } require_once('includes/init.php'); if(!isset($errMSG)){ $addv=$pdo->prepare("INSERT INTO orcamento (id_cliente, produto, medida, qtd, msg, aprovado, status, data_orca, img) VALUE(?,?,?,?,?,?,?,?,?)"); $addv->bindValue("1",$id_cliente); $addv->bindValue("2",$produto); $addv->bindValue("3",$medida); $addv->bindValue("4",$qtd); $addv->bindValue("5",$msg); $addv->bindValue("6",$aprovado); $addv->bindValue("7",$status); $addv->bindValue("8",$data_orca); $addv->bindValue("9",$userpic); if($addv->execute()) { $successMSG = "Orçamento enviado com sucesso..."; } else { $errMSG = "Erro ao enviado Orçamento..."; } } $path_file = $upload_dir.$userpic; /////////////////////////////////////////////////////////////////////////////////////////////// require 'phpmailer/PHPMailerAutoload.php'; //Create a new PHPMailer instance $mail = new PHPMailer; //Tell PHPMailer to use SMTP $mail->isSMTP(); $mail->CharSet = 'UTF-8'; //Enable SMTP debugging // 0 = off (for production use) // 1 = client messages // 2 = client and server messages $mail->SMTPDebug = 0; //Ask for HTML-friendly debug output $mail->Debugoutput = 'html'; //Set the hostname of the mail server $mail->Host = "smtp.uhserver.com"; //Set the SMTP port number - likely to be 25, 465 or 587 $mail->Port = 587; //Whether to use SMTP authentication $mail->SMTPAuth = true; //Username to use for SMTP authentication $mail->Username = "contato@xxxxx.com.br"; //Password to use for SMTP authentication $mail->Password = "xxxxxx"; //Set who the message is to be sent from $mail->setFrom('contato@xxxxx.com.br', 'xxxxx'); //Set an alternative reply-to address $mail->addReplyTo('no-reply@xxxxx.com.br', 'xxxxx'); //Set who the message is to be sent to $mail->addAddress('contato@xxxxx.com.br', 'xxxxx'); //Mantenha-o simples - não use HTML $mail->isHTML(true); $id = $_SESSION['id_do_produto']; $add_pro = $pdo->prepare("SELECT * FROM produtos WHERE id = '$id' ORDER BY nome_produto ASC"); $add_pro->execute(); while($row=$add_pro->fetch(PDO::FETCH_ASSOC)){ extract($row); $assunto = ''.$row['nome_produto'].''; } //Set the subject line $mail->Subject = 'Solicitação de orcamento de: '.$assunto.''; $mail->Body = ' <html bgcolor="#E6E6E6"> <table able width="60%" align="center" style="background-color:#ffffff; border:1px solid #cccccc;"> <tr style="background-color:#ffffff; border: 1px solid #cccccc;"> <td><a href="http://xxxxx.com.br" target="_blank"><img src="http://xxxxx.com.br/imagens/logo.png" width="300" height="80" /></a></td> </tr> <tr> <td colspan="3"><hr / style="color:#cccccc;"></td> </tr> <tr style="background-color:#ffffff; border: 1px solid #cccccc;"> <td style="color:blue;"><strong> '.$assunto.'</strong></td> </tr> <tr> <td colspan="3"><hr / style="color:#cccccc;"></td> </tr> <tr> <td colspan="2">'.$msg.'</td> </tr> <tr> <td colspan="3"><hr / style="color:#cccccc;"></td> </tr> <tr> <td colspan="3" style="font-size:9px;">Roda pé do formulário</td> </tr> </table> </html> '; //$mail->AddAttachment($path_file); //Read an HTML message body from an external file, convert referenced images to embedded, //convert HTML into a basic plain-text alternative body //$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__)); //Replace the plain text body with one created manually //$mail->AltBody = 'This is a plain-text message body'; //Attach an image file //$mail->addAttachment('examples/images/phpmailer_mini.png'); //send the message, check for errors if (!$mail->send()) { //echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Mensagem Enviada!"; header('Location: index.php'); } } ?> <br/><br/> <table class="table table-bordered table-responsive"> <form method="post" enctype="multipart/form-data" class="form-horizontal"> <tr> <td><label class="control-label">Produto:</label></td> <?php $id = $_SESSION['id_do_produto']; $add_pro = $pdo->prepare("SELECT * FROM produtos WHERE id = '$id' ORDER BY nome_produto ASC"); $add_pro->execute(); while($row=$add_pro->fetch(PDO::FETCH_ASSOC)){ extract($row); echo'<td><input class="form-control" type="text" name="produto" value="'.$row['nome_produto'].'"/></td>'; } ?> </tr> <tr> <td><label class="control-label">Cliente:</label></td> <td><input class="form-control" type="text" name="" value="<?php echo $_SESSION['c_nome'] ?>"/> <input class="form-control" type="hidden" name="id_cliente" value="<?php echo $_SESSION['c_id'] ?>"/></td> </tr> <tr> <td><label class="control-label">Medida: <i style="font-size: 11px">Altura X Largura</i></label></td> <td><input class="form-control" type="text" name="medida" placeholder="0,00 x 0,00" /></td> </tr> <tr> <td><label class="control-label">Quantidde:</label></td> <td><input class="form-control" type="text" name="qtd" /></td> </tr> <tr> <td><label class="control-label">Mensagem.</label></td> <td><textarea class="form-control" type="text" name="msg" rows="3" placeholder="Mensagem"></textarea></td> </tr> <input class="form-control" type="hidden" name="aprovado" value="Não" /> <input class="form-control" type="hidden" name="status" value="Aberto" /> <tr> <td><label class="control-label">Envie seu Layout.</label></td> <td><input class="input-group" type="file" name="user_image" accept="image/*" /></td> </tr> <tr> <td colspan="2" style="text-align:center; padding: 30px;"><button type="submit" name="btnsave" class="btn btn-primary"> <span class="glyphicon glyphicon-save"></span> &nbsp; Enviar Orçamento &nbsp; </button> </td> </tr> </form> </table> </div><!-- /.row --> </div><!-- /.col-md-12 --> </div><!-- /.row --> </div><!-- /.container --> <?php include 'footer.php'; ?>  
    • By paulo padua
      Olá  pessoal  
      Estou precisando de uma ajuda. Utilizo o PHPMailer com Gmail e tudo ok. Mas preciso configurar ele para um conta Hotmail. Já verifiquei na Internet as configurações mas gera erra no envio. Utilizei o servidor SMTP.live.com e porta 587  e tls e até ssl e não gera o mesmo  erro.
       
      Alguém poderia me informar como eu resolvo esse problema?
       
       
       
      019-10-08 20:18:00 Connection: opening to smtp.live.com:587, timeout=300, options=array ( 'ssl' => array ( 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true, ),) 2019-10-08 20:18:00 Connection: opened 2019-10-08 20:18:00 SMTP INBOUND: "220 CP2P15201CA0018.outlook.office365.com Microsoft ESMTP MAIL Service ready at Tue, 8 Oct 2019 20:17:58 +0000" 2019-10-08 20:18:00 SERVER -> CLIENT: 220 CP2P15201CA0018.outlook.office365.com Microsoft ESMTP MAIL Service ready at Tue, 8 Oct 2019 20:17:58 +0000 2019-10-08 20:18:00 CLIENT -> SERVER: EHLO localhost 2019-10-08 20:18:00 SMTP INBOUND: "250-CP2P15201CA0018.outlook.office365.com Hello [2804:14c:c0:83d8:899e:1d6c:a4ab:f228]" 2019-10-08 20:18:00 SMTP INBOUND: "250-SIZE 157286400" 2019-10-08 20:18:00 SMTP INBOUND: "250-PIPELINING" 2019-10-08 20:18:00 SMTP INBOUND: "250-DSN" 2019-10-08 20:18:00 SMTP INBOUND: "250-ENHANCEDSTATUSCODES" 2019-10-08 20:18:00 SMTP INBOUND: "250-STARTTLS" 2019-10-08 20:18:00 SMTP INBOUND: "250-8BITMIME" 2019-10-08 20:18:00 SMTP INBOUND: "250 SMTPUTF8" 2019-10-08 20:18:00 SERVER -> CLIENT: 250-CP2P15201CA0018.outlook.office365.com Hello [2804:14c:c0:83d8:899e:1d6c:a4ab:f228]250-SIZE 157286400250-PIPELINING250-DSN250-ENHANCEDSTATUSCODES250-STARTTLS250-8BITMIME250 SMTPUTF8 2019-10-08 20:18:00 CLIENT -> SERVER: STARTTLS 2019-10-08 20:18:00 SMTP INBOUND: "220 2.0.0 SMTP server ready" 2019-10-08 20:18:00 SERVER -> CLIENT: 220 2.0.0 SMTP server ready 2019-10-08 20:18:00 CLIENT -> SERVER: EHLO localhost 2019-10-08 20:18:00 SMTP INBOUND: "250-CP2P15201CA0018.outlook.office365.com Hello [2804:14c:c0:83d8:899e:1d6c:a4ab:f228]" 2019-10-08 20:18:00 SMTP INBOUND: "250-SIZE 157286400" 2019-10-08 20:18:00 SMTP INBOUND: "250-PIPELINING" 2019-10-08 20:18:00 SMTP INBOUND: "250-DSN" 2019-10-08 20:18:00 SMTP INBOUND: "250-ENHANCEDSTATUSCODES" 2019-10-08 20:18:00 SMTP INBOUND: "250-AUTH LOGIN XOAUTH2" 2019-10-08 20:18:00 SMTP INBOUND: "250-8BITMIME" 2019-10-08 20:18:00 SMTP INBOUND: "250 SMTPUTF8" 2019-10-08 20:18:00 SERVER -> CLIENT: 250-CP2P15201CA0018.outlook.office365.com Hello [2804:14c:c0:83d8:899e:1d6c:a4ab:f228]250-SIZE 157286400250-PIPELINING250-DSN250-ENHANCEDSTATUSCODES250-AUTH LOGIN XOAUTH2250-8BITMIME250 SMTPUTF8 2019-10-08 20:18:00 Auth method requested: UNSPECIFIED 2019-10-08 20:18:00 Auth methods available on the server: LOGIN,XOAUTH2 2019-10-08 20:18:00 Requested auth method not available: 2019-10-08 20:18:00 Auth method selected: LOGIN 2019-10-08 20:18:00 CLIENT -> SERVER: AUTH LOGIN 2019-10-08 20:18:00 SMTP INBOUND: "334 VXNlcm5hbWU6" 2019-10-08 20:18:00 SERVER -> CLIENT: 334 VXNlcm5hbWU6 2019-10-08 20:18:00 CLIENT -> SERVER: cGF1bG9fZGVfbGFjZXJkYUBob3RtYWlsLmNvbQ== 2019-10-08 20:18:00 SMTP INBOUND: "334 UGFzc3dvcmQ6" 2019-10-08 20:18:00 SERVER -> CLIENT: 334 UGFzc3dvcmQ6 2019-10-08 20:18:00 CLIENT -> SERVER: UEB1bG9QYWR1YTI0MDYg 2019-10-08 20:18:03 SMTP INBOUND: "235 2.7.0 Authentication successful" 2019-10-08 20:18:03 SERVER -> CLIENT: 235 2.7.0 Authentication successful 2019-10-08 20:18:03 CLIENT -> SERVER: MAIL FROM:<emailtambem@gmail.com> 2019-10-08 20:18:03 SMTP INBOUND: "250 2.1.0 Sender OK" 2019-10-08 20:18:03 SERVER -> CLIENT: 250 2.1.0 Sender OK 2019-10-08 20:18:03 CLIENT -> SERVER: RCPT TO:<emailtambem@gmail.com> 2019-10-08 20:18:03 SMTP INBOUND: "250 2.1.5 Recipient OK" 2019-10-08 20:18:03 SERVER -> CLIENT: 250 2.1.5 Recipient OK 2019-10-08 20:18:03 CLIENT -> SERVER: DATA 2019-10-08 20:18:03 SMTP INBOUND: "354 Start mail input; end with <CRLF>.<CRLF>" 2019-10-08 20:18:03 SERVER -> CLIENT: 354 Start mail input; end with <CRLF>.<CRLF> 2019-10-08 20:18:03 CLIENT -> SERVER: Date: Tue, 8 Oct 2019 20:18:00 +0000 2019-10-08 20:18:03 CLIENT -> SERVER: To: Nome esta correto <emailtambem@gmail.com> 2019-10-08 20:18:03 CLIENT -> SERVER: From: First Last <emailtambem@gmail.com> 2019-10-08 20:18:03 CLIENT -> SERVER: Reply-To: First Last <replyto@example.com> 2019-10-08 20:18:03 CLIENT -> SERVER: Subject: PHPMailer GMail SMTP test 2019-10-08 20:18:03 CLIENT -> SERVER: Message-ID: <aIAlUeaoBd7VG6a2DIVHBqZ6KXzxaPmnUxcn1jlcXYQ@localhost> 2019-10-08 20:18:03 CLIENT -> SERVER: X-Mailer: PHPMailer 6.1.1 (https://github.com/PHPMailer/PHPMailer) 2019-10-08 20:18:03 CLIENT -> SERVER: MIME-Version: 1.0 2019-10-08 20:18:03 CLIENT -> SERVER: Content-Type: multipart/alternative; 2019-10-08 20:18:03 CLIENT -> SERVER: boundary="b1_aIAlUeaoBd7VG6a2DIVHBqZ6KXzxaPmnUxcn1jlcXYQ" 2019-10-08 20:18:03 CLIENT -> SERVER: Content-Transfer-Encoding: 8bit 2019-10-08 20:18:03 CLIENT -> SERVER: 2019-10-08 20:18:03 CLIENT -> SERVER: This is a multi-part message in MIME format. 2019-10-08 20:18:03 CLIENT -> SERVER: --b1_aIAlUeaoBd7VG6a2DIVHBqZ6KXzxaPmnUxcn1jlcXYQ 2019-10-08 20:18:03 CLIENT -> SERVER: Content-Type: text/plain; charset=us-ascii 2019-10-08 20:18:03 CLIENT -> SERVER: 2019-10-08 20:18:03 CLIENT -> SERVER: This is a plain-text message body 2019-10-08 20:18:03 CLIENT -> SERVER: 2019-10-08 20:18:03 CLIENT -> SERVER: --b1_aIAlUeaoBd7VG6a2DIVHBqZ6KXzxaPmnUxcn1jlcXYQ 2019-10-08 20:18:03 CLIENT -> SERVER: Content-Type: text/html; charset=us-ascii 2019-10-08 20:18:03 CLIENT -> SERVER: 2019-10-08 20:18:03 CLIENT -> SERVER: <h1> Teste </h1> 2019-10-08 20:18:03 CLIENT -> SERVER: 2019-10-08 20:18:03 CLIENT -> SERVER: 2019-10-08 20:18:03 CLIENT -> SERVER: --b1_aIAlUeaoBd7VG6a2DIVHBqZ6KXzxaPmnUxcn1jlcXYQ-- 2019-10-08 20:18:03 CLIENT -> SERVER: 2019-10-08 20:18:03 CLIENT -> SERVER: . 2019-10-08 20:18:04 SMTP INBOUND: "554 5.2.0 STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message due to a permanent exception with message Cannot submit message. 0.35250:0A00D884, 1.36674:0A000000, 1.61250:00000000, 1.45378:02000000, 1.44866:49020000, 1.36674:0E000000, 1.61250:00000000, 1.45378:4E020000, 1.44866:2E010000, 16.55847:E2030000, 17.43559:0000000004020000000000000000000000000000, 20.52176:140F17891500001043050000, 20.50032:140F17898617001000000000, 0.35180:0A000000, 255.23226:0000" 2019-10-08 20:18:04 SERVER -> CLIENT: 554 5.2.0 STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message due to a permanent exception with message Cannot submit message. 0.35250:0A00D884, 1.36674:0A000000, 1.61250:00000000, 1.45378:02000000, 1.44866:49020000, 1.36674:0E000000, 1.61250:00000000, 1.45378:4E020000, 1.44866:2E010000, 16.55847:E2030000, 17.43559:0000000004020000000000000000000000000000, 20.52176:140F17891500001043050000, 20.50032:140F17898617001000000000, 0.35180:0A000000, 255.23226:0000 2019-10-08 20:18:04 SMTP ERROR: DATA END command failed: 554 5.2.0 STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message due to a permanent exception with message Cannot submit message. 0.35250:0A00D884, 1.36674:0A000000, 1.61250:00000000, 1.45378:02000000, 1.44866:49020000, 1.36674:0E000000, 1.61250:00000000, 1.45378:4E020000, 1.44866:2E010000, 16.55847:E2030000, 17.43559:0000000004020000000000000000000000000000, 20.52176:140F17891500001043050000, 20.50032:140F17898617001000000000, 0.35180:0A000000, 255.23226:0000 SMTP Error: data not accepted. Mailer Error: SMTP Error: data not accepted.SMTP server error: DATA END command failed Detail: STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message due to a permanent exception with message Cannot submit message. 0.35250:0A00D884, 1.36674:0A000000, 1.61250:00000000, 1.45378:02000000, 1.44866:49020000, 1.36674:0E000000, 1.61250:00000000, 1.45378:4E020000, 1.44866:2E010000, 16.55847:E2030000, 17.43559:0000000004020000000000000000000000000000, 20.52176:140F17891500001043050000, 20.50032:140F17898617001000000000, 0.35180:0A000000, 255.23226:0000 SMTP code: 554 Additional SMTP info: 5.2.02019-10-08 20:18:04 CLIENT -> SERVER: QUIT 2019-10-08 20:18:04 SMTP INBOUND: "0000, 255.27962:0A000000, 255.27962:0E000000, 255.31418:0A000000, 0.35250:00000000, 1.36674:0A000000, 1.61250:00000000, 1.45378:02000000, 1.44866:42000000, 1.36674:32000000, 1.61250:00000000, 1.45378:47000000, 1.44866:01000000, 16.55847:AE000000, 17.43559:0000000000030000000000000000000000000000, 20.52176:140F1789150070200A005C85, 20.50032:140F17898617F01F6B050000, 0.35180:0A000000, 255.23226:4800D13D, 255.27962:0A000000, 255.27962:32000000, 255.17082:DC040000, 0.27745:02000000, 4.21921:DC040000, 255.27962:FA" 2019-10-08 20:18:04 SMTP INBOUND: "000000, 255.1494:00000000, 0.38698:0F010480, 0.37692:01000000, 0.37948:13000100, 5.33852:00000000534D545000000100, 7.36354:010000000000010905000780, 4.56248:DC040000, 7.40748:010000000000010B05000780, 7.57132:000000000000000000000000, 1.63016:32000000, 4.39640:DC040000, 8.45434:FDBF0600AF84EF3B000000000000000013000100, 5.10786:0000000031352E32302E323332372E3030343A424C30505231324D42323438343A62366536333132362D623762352D346531622D613639632D34326465393539653533363500101013000100, 7.51330:4AF8789F2C4CD7081300010" 2019-10-08 20:18:04 SMTP INBOUND: "0, 255.1750:AC050000, 255.31418:0A00CF85, 0.22753:0A00F136, 255.21817:DC040000, 4.60547:DC040000, 0.21966:0A00F636, 4.30158:DC040000 [Hostname=BL0PR12MB2484.namprd12.prod.outlook.com]" 2019-10-08 20:18:04 SMTP INBOUND: "221 2.0.0 Service closing transmission channel" 2019-10-08 20:18:04 SERVER -> CLIENT: 0000, 255.27962:0A000000, 255.27962:0E000000, 255.31418:0A000000, 0.35250:00000000, 1.36674:0A000000, 1.61250:00000000, 1.45378:02000000, 1.44866:42000000, 1.36674:32000000, 1.61250:00000000, 1.45378:47000000, 1.44866:01000000, 16.55847:AE000000, 17.43559:0000000000030000000000000000000000000000, 20.52176:140F1789150070200A005C85, 20.50032:140F17898617F01F6B050000, 0.35180:0A000000, 255.23226:4800D13D, 255.27962:0A000000, 255.27962:32000000, 255.17082:DC040000, 0.27745:02000000, 4.21921:DC040000, 255.27962:FA000000, 255.1494:00000000, 0.38698:0F010480, 0.37692:01000000, 0.37948:13000100, 5.33852:00000000534D545000000100, 7.36354:010000000000010905000780, 4.56248:DC040000, 7.40748:010000000000010B05000780, 7.57132:000000000000000000000000, 1.63016:32000000, 4.39640:DC040000, 8.45434:FDBF0600AF84EF3B000000000000000013000100, 5.10786:0000000031352E32302E323332372E3030343A424C30505231324D42323438343A62366536333132362D623762352D346531622D613639632D34326465393539653533363500101013000100, 7.51330:4AF8789F2C4CD70813000100, 255.1750:AC050000, 255.31418:0A00CF85, 0.22753:0A00F136, 255.21817:DC040000, 4.60547:DC040000, 0.21966:0A00F636, 4.30158:DC040000 [Hostname=BL0PR12MB2484.namprd12.prod.outlook.com]221 2.0.0 Service closing transmission channel 2019-10-08 20:18:04 SMTP ERROR: QUIT command failed: 0000, 255.27962:0A000000, 255.27962:0E000000, 255.31418:0A000000, 0.35250:00000000, 1.36674:0A000000, 1.61250:00000000, 1.45378:02000000, 1.44866:42000000, 1.36674:32000000, 1.61250:00000000, 1.45378:47000000, 1.44866:01000000, 16.55847:AE000000, 17.43559:0000000000030000000000000000000000000000, 20.52176:140F1789150070200A005C85, 20.50032:140F17898617F01F6B050000, 0.35180:0A000000, 255.23226:4800D13D, 255.27962:0A000000, 255.27962:32000000, 255.17082:DC040000, 0.27745:02000000, 4.21921:DC040000, 255.27962:FA000000, 255.1494:00000000, 0.38698:0F010480, 0.37692:01000000, 0.37948:13000100, 5.33852:00000000534D545000000100, 7.36354:010000000000010905000780, 4.56248:DC040000, 7.40748:010000000000010B05000780, 7.57132:000000000000000000000000, 1.63016:32000000, 4.39640:DC040000, 8.45434:FDBF0600AF84EF3B000000000000000013000100, 5.10786:0000000031352E32302E323332372E3030343A424C30505231324D42323438343A62366536333132362D623762352D346531622D613639632D34326465393539653533363500101013000100, 7.51330:4AF8789F2C4CD70813000100, 255.1750:AC050000, 255.31418:0A00CF85, 0.22753:0A00F136, 255.21817:DC040000, 4.60547:DC040000, 0.21966:0A00F636, 4.30158:DC040000 [Hostname=BL0PR12MB2484.namprd12.prod.outlook.com]221 2.0.0 Service closing transmission channel 2019-10-08 20:18:04 Connection: closed A configuração do arquivo PHP
       
      <?php use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; require './PHPMailer/Exception.php'; require './PHPMailer/PHPMailer.php'; require './PHPMailer/SMTP.php'; /** * This example shows settings to use when sending via Google's Gmail servers. * This uses traditional id & password authentication - look at the gmail_xoauth.phps * example to see how to use XOAUTH2. * The IMAP section shows how to save this message to the 'Sent Mail' folder using IMAP commands. */ //Import PHPMailer classes into the global namespace //Create a new PHPMailer instance $mail = new PHPMailer; //Tell PHPMailer to use SMTP $mail->isSMTP(); //Enable SMTP debugging // SMTP::DEBUG_OFF = off (for production use) // SMTP::DEBUG_CLIENT = client messages // SMTP::DEBUG_SERVER = client and server messages $mail->SMTPDebug = 4; //Set the hostname of the mail server $mail->Host = 'smtp.live.com'; // use // $mail->Host = gethostbyname('smtp.gmail.com'); // if your network does not support SMTP over IPv6 //Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission $mail->Port = 587; //Set the encryption mechanism to use - STARTTLS or SMTPS $mail->SMTPSecure = 'tsl'; //Whether to use SMTP authentication $mail->SMTPAuth = true; $mail->SMTPOptions = array( 'ssl' => array( 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true ) ); //Username to use for SMTP authentication - use full email address for gmail $mail->Username = " meu email "; meu email do hotmail //Password to use for SMTP authentication $mail->Password = "senha "; //aqui eu coloquei minha senha do hotmail //Set who the message is to be sent from $mail->setFrom('meuemail@gmail.com', 'First Last'); //Set an alternative reply-to address $mail->addReplyTo('replyto@example.com', 'First Last'); //Set who the message is to be sent to $mail->addAddress('meuemail@gmail.com', 'meunome'); //Set the subject line $mail->Subject = 'PHPMailer GMail SMTP test'; //Read an HTML message body from an external file, convert referenced images to embedded, //convert HTML into a basic plain-text alternative body $mail->msgHTML( "<h1> Teste </h1>"); //Replace the plain text body with one created manually $mail->AltBody = 'This is a plain-text message body'; //Attach an image file //$mail->addAttachment('images/phpmailer_mini.png'); //send the message, check for errors if (!$mail->send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message sent!"; //Section 2: IMAP //Uncomment these to save your message in the 'Sent Mail' folder. #if (save_mail($mail)) { # echo "Message saved!"; #} } ?> Se algum colega puder me dar uma luz eu agradeço. Com Gmail funciona normalmente. 
       
×

Important Information

Ao usar o fórum, você concorda com nossos Terms of Use.