Jump to content

Search the Community

Showing results for tags 'smtp'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Q&A Desenvolvimento
    • Perguntas e respostas rápidas
  • Web Development
    • HTML e CSS
    • Javascript
    • PHP
    • Ruby
    • Python
    • Java
    • .NET
    • Docker, Kubernets and other environments
    • WordPress
    • Mobile
    • Agile
    • Desenvolvimento de Games
    • Banco de Dados
    • Design and UX
    • Algoritmos & Outras Tecnologias
  • Entretenimento e uso pessoal
    • Segurança & Malwares
    • Geral
    • iMasters's pub

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Google+


Hangouts


Skype


Twitter


deviantART


Github


Flickr


LinkedIn


Pinterest


Facebook


Site Pessoal


Localização


Interesses

Found 14 results

  1. clayton.lima2020

    Erro no envio de email SMTP

    Bom dia! Pessoal estou com um problema estou tentando enviar um e-mail através de um formulário que criei no site da empresa que eu trabalho, porém na hora de enviar está dando erro. Obs: a hospedagem do site está na Locaweb Segue abaixo o erro: Fatal error: Uncaught Error: Call to undefined function eregi() in /home/storage/2/a8/c3/odontosmilesfran1/public_html/class.phpmailer.php:593 Stack trace: #0 /home/storage/2/a8/c3/odontosmilesfran1/public_html/class.phpmailer.php(518): PHPMailer->SmtpConnect() #1 /home/storage/2/a8/c3/odontosmilesfran1/public_html/class.phpmailer.php(410): PHPMailer->SmtpSend('Date: Sat, 5 Ju...', '--b1_b48d510d23...') #2 /home/storage/2/a8/c3/odontosmilesfran1/public_html/envio-franqueador.php(55): PHPMailer->Send() #3 {main} thrown in /home/storage/2/a8/c3/odontosmilesfran1/public_html/class.phpmailer.php on line 593 Segue o código do script de envio: <? require_once("class.phpmailer.php"); //Nova instância do PHPMailer $mail = new PHPMailer; //Informa que será utilizado o SMTP para envio do e-mail $mail->IsSMTP(); //Informa que a conexão com o SMTP será autênticado $mail->SMTPAuth = true; //Configura a segurança para SSL $mail->SMTPSecure = "ssl"; $mail->Port = 465; $mail->Host = "email-ssl.com.br"; //Usuário para autênticação do SMTP $mail->Username = "sejaumfranqueado@odontosmilesfranchising.com.br"; //Senha para autênticação do SMTP $mail->Password = "12345678"; // senha ficticia //Titulo do e-mail que será enviado $mail->Subject = "PEDIDO PARA SER UM FRANQUEADOR"; //Preenchimento do campo FROM do e-mail $mail->From = $mail->Username; $mail->FromName = $_POST['nome']; // Nome do remetente //E-mail para a qual o e-mail será enviado $mail->AddAddress("sejaumfranqueado@odontosmilesfranchising.com.br"); //Conteúdo do e-mail //$mail->Body = "Novo contato feito através do site Araújo Imóveis."; $mail->From = $_POST['email']; // E-mail do remetente $mail->Body .= "Modelo de Franquia: ".$_POST['modelo']."<br>"; $mail->Body .= "Nome: ".$_POST['nome']."<br>"; $mail->Body .= "Email: ".$_POST['email']."<br>"; $mail->Body .= "Fone Móvel: ".$_POST['fone']."<br>"; $mail->Body .= "Fone Fixo: ".$_POST['movel']."<br>"; $mail->Body .= "Estado: ".$_POST['estado']."<br>"; $mail->Body .= "Cidade: ".$_POST['cidade']."<br>"; $mail->Body .= "Mensagem: ".nl2br($_POST['mensagem']).""; $mail->AltBody = $mail->Body; //Dispara o e-mail $enviado = $mail->Send(); //Imprime sucesso. if($enviado) echo "<script>alert('Sua mensagem foi enviada com sucesso!')</script>"; echo "<meta http-equiv='refresh' content='2;URL=index.php'>"; ?> Segue o trecho do código do arquivo class.phpmailer.php onde está dando o erro /* Choose the mailer */ switch($this->Mailer) { case 'sendmail': $result = $this->SendmailSend($header, $body); break; case 'smtp': [b][color=red] $result = $this->SmtpSend($header, $body); // nessa linha 410 está dando erro [/color][/b] break; case 'mail': $result = $this->MailSend($header, $body); break; default: $result = $this->MailSend($header, $body); break; //$this->SetError($this->Mailer . $this->Lang('mailer_not_supported')); //$result = false; //break; } return $result; } /** Aqui está outro trecho do código: /* Retry while there is no connection */ while($index < count($hosts) && $connection == false) { $hostinfo = array(); [b][color=red] if(eregi('^(.+):([0-9]+)$', $hosts[$index], $hostinfo)) { // aqui está dando erro linha 593[/color][/b] $host = $hostinfo[1]; $port = $hostinfo[2]; } else { $host = $hosts[$index]; $port = $this->Port; } $tls = ($this->SMTPSecure == 'tls'); $ssl = ($this->SMTPSecure == 'ssl'); if($this->smtp->Connect(($ssl ? 'ssl://':'').$host, $port, $this->Timeout)) { $hello = ($this->Helo != '' ? $this->Hello : $this->ServerHostname()); $this->smtp->Hello($hello); if($tls) { if(!$this->smtp->StartTLS()) { $this->SetError($this->Lang("tls")); $this->smtp->Reset(); $connection = false; } //We must resend HELLO after tls negociation $this->smtp->Hello($hello); } $connection = true; if($this->SMTPAuth) { if(!$this->smtp->Authenticate($this->Username, $this->Password)) { $this->SetError($this->Lang('authenticate')); $this->smtp->Reset(); $connection = false; } } } $index++; } if(!$connection) { $this->SetError($this->Lang('connect_host')); } return $connection; } Obrigado a todos que puderem ajudar
  2. Oi meninos, Configurei o SendGrid em minha aplicação. Percebi que apenas e-mails terminados em "gmail.com" recebem as mensagens e outros provedores não. Poderiam checar se fiz alguma burrada abaixo e/ou me ajudar com a solução desse problema? obrigada! function send_mail($to, $subject, $message) { require 'SendGrid/vendor/autoload.php'; // Necessário inserir a chave $apiKey = 'SG.W9asjbdfaisdjn9yok6Y__FI9Ew.NrMhanDN-RKDO579ldsjfbasdfnpausiM'; $sendgrid = new \SendGrid($apiKey); $from = new SendGrid\Email(null, "meu@email.com"); $to = new SendGrid\Email(null, $to); $content = new SendGrid\Content("text/html", $message); $mail = new SendGrid\Mail($from, $subject, $to, $content); try { $response = $sendgrid->client->mail()->send()->post($mail); // print $response->statusCode() . "\n"; // print_r($response->headers()); // print $response->body() . "\n"; } catch (Exception $e) { // echo 'Caught exception: ', $e->getMessage(), "\n"; } }
  3. paulo padua

    PHPMailer com conta hotmail

    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.
  4. paulo padua

    PHPMailer com conta hotmail

    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.
  5. Estou tentando mandar uma "Blind Copy" pelo nossa Procedure de envio de email , pela documentação estaria ok , mas não está enviando nem gerando qualquer erro , o código está abaixo , os itens sensíveis foram trocados por "x" O que posso estar fazendo de errado ? SP : create or replace PROCEDURE ENVIA_EMAIL_CLOBHBC (ds_email_origem_w varchar2, ds_email_destino_p varchar2, ds_assunto varchar2, p_attach_clob IN CLOB DEFAULT NULL, p_httm in varchar2 default 'S', p_log out varchar2, p_nome_destino in varchar2 default null) is l_step PLS_INTEGER := 12000; ds_smtp_w varchar2(20) := 'xx.xx.x.xx'; /* Abre conex?o SMTP e HTTP */ CONEXAO UTL_SMTP.CONNECTION; vs_origem varchar2(100) := ds_email_origem_w; -- vs_para varchar2(100); vs_cc varchar2(100); -- PROCEDURE send_header(name IN VARCHAR2, header IN VARCHAR2) AS BEGIN UTL_SMTP.WRITE_DATA(CONEXAO, name || ': ' || header || UTL_TCP.CRLF); END; BEGIN /* Abre conex?o com um Servidor SMTP(Simple Mail Transfer Protocol), porta padr?o SMTP e 25 */ CONEXAO := utl_smtp.open_connection (ds_smtp_w,25); UTL_SMTP.HELO (CONEXAO, ds_smtp_w); /* Endereco do servidor de SMTP */ --utl_smtp.command (CONEXAO, 'AUTH LOGIN'); --utl_smtp.command (CONEXAO, utl_raw.cast_to_varchar2(utl_encode.base64_encode(utl_raw.cast_to_raw((ds_user_id_w))))); --UTL_SMTP.COMMAND (CONEXAO, UTL_RAW.CAST_TO_VARCHAR2(UTL_ENCODE.BASE64_ENCODE(UTL_RAW.CAST_TO_RAW((DS_SENHA_SMTP_W))))); UTL_SMTP.MAIL (CONEXAO, ('<' || vs_origem || '>')); /* E-mail de quem esta mandando */ -- se estiver em lista separado por ";" manda para o 1º como "para" e para o 2º como CC (copia) /* Para quem vou mandar */ IF INSTR(ds_email_destino_p,';') = 0 THEN vs_para := ds_email_destino_p; UTL_SMTP.RCPT (CONEXAO, ('<' || ds_email_destino_p || '>')); /* Para quem vou mandar */ ELSE vs_para := SUBSTR(ds_email_destino_p,1,INSTR(ds_email_destino_p,';')-1); vs_cc := SUBSTR(ds_email_destino_p,INSTR(ds_email_destino_p,';')+1,length(ds_email_destino_p)); UTL_SMTP.RCPT (CONEXAO, ('<' || vs_para || '>')); /* Para quem vou mandar original */ UTL_SMTP.RCPT (CONEXAO, ('<' || vs_cc || '>')); /* Para quem vou mandar copia */ END IF; UTL_SMTP.OPEN_DATA(CONEXAO); If upper(p_httm) <> 'S' Then send_header('Subject','=?iso-8859-1?Q?' ||UTL_RAW.CAST_TO_VARCHAR2(UTL_ENCODE.QUOTED_PRINTABLE_ENCODE(UTL_RAW.CAST_TO_RAW(ds_assunto)))); Else --send_header('Subject','=?iso-8859-1?Q?' ||UTL_RAW.CAST_TO_VARCHAR2(UTL_ENCODE.QUOTED_PRINTABLE_ENCODE(UTL_RAW.CAST_TO_RAW(ds_assunto)))|| '?='); send_header('Subject',UTL_RAW.CAST_TO_VARCHAR2(UTL_ENCODE.QUOTED_PRINTABLE_ENCODE(UTL_RAW.CAST_TO_RAW(ds_assunto)))); end if; If upper(p_httm) <> 'S' Then UTL_SMTP.write_data(CONEXAO, 'Content-Type: text/html; charset="UTF-8"' || utl_tcp.CRLF); Else UTL_SMTP.write_data(CONEXAO, 'Content-Type: text/html; charset="UTF-8"' || utl_tcp.CRLF ); end if; send_header('From',ds_email_origem_w); --se denominou o destino formata o envio , senão vai o proprio email --tratamento diferente do "from" pois este é em geral dinamico --feito pela stored procedure chamadora if trim(p_nome_destino) is null then send_header('To',vs_para); else send_header('To','"'||trim(p_nome_destino)||'" <'||vs_para||'>'); end if; If Trim(vs_cc) is not null Then--copia (nao formata o destino) send_header('CC',vs_cc); end if; send_header('BCC',vs_origem);---<<< A LINHA COM PROBLEMA PARECE SER ESTA *********************** FOR i IN 0 .. TRUNC((DBMS_LOB.getlength(p_attach_clob) - 1 )/l_step) LOOP UTL_SMTP.WRITE_DATA(CONEXAO, DBMS_LOB.substr(p_attach_clob, l_step, i * l_step + 1)); END LOOP; UTL_SMTP.CLOSE_DATA(CONEXAO); UTL_SMTP.QUIT (CONEXAO); Exception when OTHERS then utl_smtp.quit (conexao); p_log := 'Erro: ' || SQLERRM; END ENVIA_EMAIL_CLOBHBC;
  6. Boa tarde, Estou a desenvolver uma plataforma php mysql crm no dominio "abcd.com" (falso) em que dois clientes diferentes partilham a mesma plataforma nesse dominio. Eu queria que numa dada página desse para enviar emails para os clientes dos meus clientes e para isso queria usar os emails com autenticação smtp dos respetivos dominios. Por exemplo: meu cliente 1 (geral@cliente1.com) meu cliente 2 (geral@www.cliente2.com). Eu tenho os dados de acesso aos emails (user, password, servidor smtp). Dá para fazer isto?
  7. mattwaster

    Erro ao enviar e-mail

    Bom dia ! Estou com problemas no envio de informações por um de meus formulários, o seguinte erro aparece : Segue código do enviarEmail : <?php // Inclui o arquivo class.phpmailer.php localizado na pasta phpmailer require("phpmailer/class.phpmailer.php"); require("phpmailer/PHPMailerAutoload.php"); // Inicia a classe PHPMailer $mail = new PHPMailer(); // Define os dados do servidor e tipo de conexão // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= $mail->IsSMTP(); // Define que a mensagem será SMTP //$mail->Host = "smtp.wisewood.eco.br"; // Endereço do servidor SMTP (caso queira utilizar a autenticação, utilize o host smtp.seudomínio.com.br) $mail->Host = "smtp.gmail.com.br"; $mail->SMTPAuth = true; // Usar autenticação SMTP (obrigatório para smtp.seudomínio.com.br) $mail->SMTPSecure = tls; // Protocolo de Segurança (Anteriormente estava sem) $mail->Username = 'webmaster@wisewood.com.br'; // Usuário do servidor SMTP (endereço de email) $mail->Password = 'xxxxxx'; // Senha do servidor SMTP (senha do email usado) $mail->Port = "587"; // Define o remetente // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= $mail->From = "webmaster@wisewood.com.br"; // Seu e-mail $mail->Sender = "webmaster@wisewood.com.br"; // Seu e-mail $mail->FromName = "Site"; // Seu nome // Define os destinatário(s) // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= $mail->AddAddress('comercial@wise.eco.br', 'webmaster@wisewood.com.br'); $mail->AddAddress('webmaster@wisewood.com.br'); //$mail->AddCC('ciclano@site.net', 'Ciclano'); // Copia //$mail->AddBCC('fulano@dominio.com.br', 'Fulano da Silva'); // Cópia Oculta // Define os dados técnicos da Mensagem // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= $mail->IsHTML(true); // Define que o e-mail será enviado como HTML //$mail->CharSet = 'iso-8859-1'; // Charset da mensagem (opcional) $mail->CharSet = 'utf-8'; // Charset da mensagem (opcional) // Define a mensagem (Texto e Assunto) // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= $tipoformulario=$_POST['tipoformulario']; if ($tipoformulario=="fornecedor") { $mail->Subject = "Contato de fornecedor pelo site "; // Assunto da mensagem $nome=$_POST['nome']; $email=$_POST['email']; $telefone=$_POST['telefone']; $celular=$_POST['celular']; $empresa=$_POST['empresa']; $endereco=$_POST['endereco']; $cidade=$_POST['cidade']; $uf=$_POST['uf']; $cep=$_POST['cep']; $outros=$_POST['outros']; $newfornecimento=""; foreach($_POST["fornecimento"] as $fornecimento) { $newfornecimento .= $fornecimento ." | "; } $mensagem = " Nome completo: ". $nome ." <br> Email: ". $email ."<br> Telefone: ". $telefone ."<br> Celular: ". $celular ."<br> Empresa: ". $empresa ."<br> Endereço: ". $endereco ."<br> Cidade: ". $cidade ."<br> UF: ". $uf ."<br> CEP: ". $cep."<br> fornecimento: ". $newfornecimento ."<br> Outros: ". $outros ."<br> "; $redirecionamento = "fornecedores.php"; }elseif ($tipoformulario=="contato") { $mail->Subject = "Contato pelo site "; // Assunto da mensagem $nome=$_POST['nome']; $email=$_POST['email']; $telefone=$_POST['telefone']; $empresa=$_POST['empresa']; $assunto=$_POST['assunto']; $texto=$_POST['mensagem']; $mensagem = " Nome completo: ". $nome ." <br> Email: ". $email ."<br> Telefone: ". $telefone ."<br> Empresa: ". $empresa ."<br> Assunto: ". $assunto ."<br> texto: ". $texto ."<br> "; $redirecionamento = "contato.php"; }elseif ($tipoformulario=="sobmedida") { $mail->Subject = "Contato pelo site (sobmedida) "; // Assunto da mensagem $nome=$_POST['nome']; $email=$_POST['email']; $empresa=$_POST['empresa']; $texto=$_POST['mensagem']; $mensagem = " Nome completo: ". $nome ." <br> Email: ". $email ."<br> Empresa: ". $empresa ."<br> texto: ". $texto ."<br> "; $redirecionamento = "sobmedida.php"; } $mail->Body = $mensagem; $mail->AltBody = $nome; // Define os anexos (opcional) //$mail->AddAttachment("img/back.jpg", "back.jpg"); // Insere um anexo // Envia o e-mail $enviado = $mail->Send(); // Limpa os destinatários e os anexos $mail->ClearAllRecipients(); $mail->ClearAttachments(); // Exibe uma mensagem de resultado if ($enviado) { echo "E-mail enviado com sucesso!"; header("location:". $redirecionamento. ""); } else { echo "Não foi possível enviar o e-mail. "; echo "Informações do erro: " . $mail->ErrorInfo; } ?> Alguém pode me ajudar ?
  8. Jiraya Tupiniquim

    SMTP connect() failed. (PHPMailer)

    Pessoal, boa noite! Pessoa, estou com um erro para enviar e-mail pelo formulário na conta da Godaddy. Alguém pode me ajudar? Ao tentar enviar o e-mail aparece o seguinte código de erro. "SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting" segue abaixo meu código, engraçado é que estava funcionando, mas não mais, não mexemos em nenhuma configuração. /* apenas dispara o envio do formulário caso exista $_POST['enviarFormulario']*/ if (isset($_POST['enviarFormulario'])){ /*** INÍCIO - DADOS A SEREM ALTERADOS DE ACORDO COM SUAS CONFIGURAÇÕES DE E-MAIL ***/ $enviaFormularioParaNome = 'NOME DO CLIEnTE'; $enviaFormularioParaEmail = 'contato@exemplo.com.br'; $caixaPostalServidorNome = 'NOME DA EMPRESS| Site'; $caixaPostalServidorEmail = 'contato@exemplo.com.br'; $caixaPostalServidorSenha = 'SENHA DO CLIENTE'; /*** FIM - DADOS A SEREM ALTERADOS DE ACORDO COM SUAS CONFIGURAÇÕES DE E-MAIL ***/ /* abaixo as veriaveis principais, que devem conter em seu formulario*/ $remetenteNome = $_POST['remetenteNome']; $remetLastName = $_POST['remetLastName']; $remetenteEmail = $_POST['remetenteEmail']; $assunto = $_POST['assunto']; $telefone = $_POST['telefone']; $remetenteCidade = $_POST['remetenteCidade']; $remetenteEstado = $_POST['remetenteEstado']; $mensagem = $_POST['mensagem']; // Formulário $mensagemConcatenada = 'SITE - Site'.'<br/>'; $mensagemConcatenada .= '-------------------------------<br/>'; $mensagemConcatenada .= 'Nome: <b>'.$remetenteNome.'</b><br/>'; $mensagemConcatenada .= 'Sobrenome: <b>'.$remetLastName.'</b><br/>'; $mensagemConcatenada .= 'E-mail: <b>'.$remetenteEmail.'</b><br/>'; $mensagemConcatenada .= 'Assunto: <b>'.$assunto.'</b><br/>'; $mensagemConcatenada .= 'Telefone: <b>'.$telefone.'</b><br/>'; $mensagemConcatenada .= 'Cidade: <b>'.$remetenteCidade.'</b><br/>'; $mensagemConcatenada .= 'Estado: <b>'.$remetenteEstado.'</b><br/>'; $mensagemConcatenada .= '-------------------------------<br/>'; $mensagemConcatenada .= 'Mensagem: "<b>'.$mensagem.'"</b><br/>'; /********************************** A PARTIR DAQUI NAO ALTERAR ***********************************/ require_once('phpmail/PHPMailerAutoload.php'); $mail = new PHPMailer(); $mail->IsSMTP(); $mail->Host = "localhost"; $mail->SMTPAuth = false; $mail->SMTPSecure = false; $mail->Charset = 'utf8_decode()'; $mail->Port = 25; $mail->Username = ""; $mail->Password = ""; $mail->SMTPDebug = 0; $mail->From = $caixaPostalServidorEmail; $mail->FromName = utf8_decode($caixaPostalServidorNome); $mail->IsHTML(true); $mail->Subject = utf8_decode($assunto); $mail->Body = utf8_decode($mensagemConcatenada); $mail->AddAddress($enviaFormularioParaEmail,utf8_decode($enviaFormularioParaNome)); if(!$mail->Send()){ $mensagemRetorno = '<h5>Erro ao enviar formulário:</h5>'. print($mail->ErrorInfo); }else{ $mensagemRetorno = '<h5>Formulário enviado com sucesso!</h5>'; } }
  9. Alguém sabe me dizer por que não esta enviando o e-mail? <?php // Caminho da biblioteca PHPMailer require 'PHPMailer/PHPMailerAutoload.php'; function enviaEmail($nome,$min,$atual, $conteudo, $destinatario, $qtd){ // Instância do objeto PHPMailer $mail = new PHPMailer; // Configura para envio de e-mails usando SMTP $mail->isSMTP(); // Servidor SMTP $mail->Host = 'email-ssl.com.br'; // Usar autenticação SMTP $mail->SMTPAuth = true; // Usuário da conta $mail->Username = 'estoque@highflexestoque.servicos.ws'; // Senha da conta $mail->Password = 'hfxd78900'; // Tipo de encriptação que será usado na conexão SMTP $mail->Port = 587; // Informa se vamos enviar mensagens usando HTML $mail->IsHTML(true); // Email do Remetente $mail->From = 'estoque@highflexestoque.servicos.ws'; $mail->addAddress('marlon.valentim@hotmail.com'); // Assunto do e-mail if($conteudo=='' || $destinatario==''){ $mail->Subject = 'MINIMO ESTOQUE'; // Nome do Remetente $mail->FromName = 'HFX ESTOQUE'; // Mensagem que vai no corpo do e-mail // Endereço do e-mail do destinatário //$mail->addAddress('financeiro@hfxdigital.com'); $mail->Body = "<h1>ATINGIMOS A MARGEM DE SEGURANCA MINIMA DO MATERIAL: $nome.</h1> <h1> O ESTOQUE MINIMO E DE: $min.</h1> <h1> O ESTOQUE ATUAL E DE : $atual.</h1> <h1> FAVOR, REPOR O ESTOQUE DE : $nome.</h1>"; } if($destinatario!=''){ // Endereço do e-mail do destinatário $mail->addAddress($destinatario); } if($conteudo=='erro_produto'){ $mail->Subject = 'Erro'; $mail->FromName = 'HFX ESTOQUE'; $mail->Body = "<h1>Erro na baixa do produto automatica : $nome e Quantidade = $qtd.</h1> Já alterou? <a href='http://mattosdesign.servicos.ws/retirada.php?produtos=$nome&quantidade_mat=$qtd'>Retirar novamente o produto</a>"; } // Envia o e-mail e captura o sucesso ou erro if($mail->Send()): echo 'Enviado com sucesso !'; else: echo 'Erro ao enviar Email:' . $mail->ErrorInfo; endif; } ?>
  10. Olá! Pessoal, estou utilizando o phpMailer para envio de email. O gmail está com uma segurança automática que evita o recebimento. Então fica necessário que o usuário modifique essa configuração para liberar o recebimento. Vocês sabem alguma forma de configurar o código pra evitar isso automaticamente? $mail = new PHPMailer(); $mail2 = new PHPMailer(); /* ................................ Receber solicit ................................... */ $mail->Username = "email"; // your GMail user name $mail->Password = "senha"; $mail->AddAddress("email","Tesste"); // recipients email $mail->FromName = $email; // readable name $mail->Subject = $nome; $mail->isHTML(true); $mail->Body = $receber_solicit; //----------------------------------------------------------------------- $mail->Host = "smtp.gmail.com"; // GMail $mail->Port = 587; $mail->IsSMTP(); // use SMTP $mail->SMTPAuth = true; // turn on SMTP authentication $mail->From = $mail->Username; if(!$mail->Send()) echo "Mailer Error: " . $mail->ErrorInfo; else echo "Mensagem enviada"; /* ............................... /Receber solicit ................................... */ /* ********************************************************************* */ /* ............................... Enviar resposta ................................... */ $mail2->Username = "email"; // your Gmail2 user name $mail2->Password = "senha"; $mail2->AddAddress($email); // recipients email2 $mail2->FromName = 'Empresa'; // readable name $mail2->Subject = 'Agradecemos o seu contato!'; $mail2->isHTML(true); $mail2->Body = $enviar_resposta_auto; //----------------------------------------------------------------------- $mail2->Host = "smtp.gmail.com"; // Gmail2 $mail2->Port = 587; $mail2->IsSMTP(); // use SMTP $mail2->SMTPAuth = true; // turn on SMTP authentication $mail2->From = $mail2->Username; if(!$mail2->Send()) echo "mailer Error: " . $mail2->ErrorInfo; else echo "Mensagem enviada"; /* .............................. /Enviar resposta ................................... */
  11. Olá tenho um site hospedado na locaweb com a versão 4.7 do WordPress, uso cpanel e tenho o plugin contact form 7 e o easy SMTP instalados, porém configuro direitinho e sempre da erro "SMTP Error: Could not connect to SMTP host" ou "SMTP connect() failed." Já configure com host do Gmail e do Outlook e sempre dá esse erro. Minha dúvida é se error ocorre pq é preciso ter um certificado SSL ou se o problema é na versão do PHPMailler ou na hospedagem?
  12. Olá, estou usando o phpMailer para envio de email utilizando o gmail. Funciona normalmente em localhost, mas não na minha hospedagem. Esse é o trecho que define o host e porta: $mail->Host = 'smtp.gmail.com'; // SMTP utilizado $mail->Port = 465; // A porta 587 deverá estar aberta em seu servidor Vi um outro post antigo com esse mesmo problema, porém não consegui fazer funcionar. Ocorre o seguinte erro (apenas quando está na hospedagem, no localhost funciona corretamente): SMTP -> ERROR: Failed to connect to server: Connection timed out (110) The following From address failed: *********@gmail.com : Called Mail() without being connected
  13. Olá, estou com um prolema, um usuário aqui da empresa está alegando que não teve acesso aos e-mails, precisamos localizar os e-mails que enviamos (através de um provedor de e-mail marketing) , o provedor de e-mail exibe que o e-mail foi enviado. porem estes e-mails foram apagados da caixa de e-mail do mesmo via Webmail (roundcube), eu só preciso encontrar em algum log a data que foi apagado, gostaria de saber se isso é possível através de uma instalação padrão WHM? Já olhei nos seguintes arquivos e não encontrei nada. /var/cpanel/roundcube/log/ /usr/local/cpanel/logs/access_log /var/log/exim_mainlog /var/log/maillog /var/log/messages isso é possível? de alguma forma provar que ele teve acesso e apagou os e-mails ?
  14. Boa tarde Pessoal. Tenho um plano Revenda na UOL HOST. E ela tem um problema sério. Não faz envio de e-mail através de serviços externos, somente interno e mesmo usando o código interno a merd... não funciona. aqui tá o tutorial deles: http://www.uolhost.uol.com.br/faq/revenda/como-enviar-mensagens-com-php-por-autenticacao-smtp-na-revenda.html No qual implementei em http://www.llcoban.com.br/sistema/func_php/teste_m.php e da erro de time out. Então como alternativa, fechei com um parceiro pra implementar algo bem simples no servidor dele um arquivo php mailer que funciona perfeitamente. E foi em meu servidor como solução e usando HttpResques eu chama este arquivo e fazia o disparo até quinta passada. pois depois de quinta até agora não faz mais disparo nenhum. da o seguinte erro: Response error: 0 (7: Failed connect to programador1.tempsite.ws:80; Connection timed out) O que eu já tentei. Como citei php mailer em um servidor externo. Envio interno usando php mailer. Envio interno usando o tuto deles. Envio interno usando curl_init Ai estou aqui solicitando uma alterativa pra mim contornar sem tem que migrar o sistema/site de meu cliente.
×

Important Information

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