Created
November 13, 2015 14:19
-
-
Save raphaelchaib/c5bbcac7566333114e92 to your computer and use it in GitHub Desktop.
WordPress: Permite o envio de e-mails pela Locaweb adicionando configurações específicas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
A hospedagem é Locaweb? ou Revenda nova Locaweb? Está com problemas? | |
No plugin Contact Form 7: | |
Configurar o campo DE com o e-mail da própria locaweb (seu_email@seu_dominio.com.br). | |
Em "Cabeçalhos adicionais", inserir: | |
Reply-To: [email-315] (Alterar este shortcode para a id da sua tag) | |
Return-Path: [email protected] | |
Abra o arquivo functions.php do seu tema e adicione as seguintes linhas ao final do arquivo, alterando os dados em maíusculo: | |
*/ | |
add_action( 'phpmailer_init', 'ideia_custom_phpmailer_config' ); | |
function ideia_custom_phpmailer_config( PHPMailer $phpmailer ) { | |
$phpmailer->From = '[email protected]'; | |
$phpmailer->FromName = ''; // Deixar vazio | |
$phpmailer->Sender= '[email protected]'; | |
$phpmailer->Host = 'smtp.SERVIDOR.com.br'; | |
$phpmailer->Port = 587; | |
$phpmailer->Username = '[email protected]'; // if required | |
$phpmailer->Password = 'SENHA'; // if required | |
$phpmailer->SMTPAuth = true; // if required | |
// $phpmailer->SMTPSecure = 'ssl'; // enable if required, 'tls' is another possible value | |
// $phpmailer->addCustomHeader("X-Priority: 3"); | |
$phpmailer->IsSMTP(); | |
} | |
/* | |
Google Apps utiliza as seguintes configurações: | |
$phpmailer->Host = smtp.gmail.com; | |
$phpmailer->Port = 587; | |
$phpmailer->SMTPSecure = 'tls'; | |
Para mais configurações do PHPMailer, acessar a documentação da classe em: http://phpmailer.worxware.com/index.php?pg=methods | |
Abra o arquivo class-phpmailer.php que está em wp-includes e na variável rt adicione o “-r”. como descrito abaixo (linha 657, pode alterar essa linha conforme a versão do WP) | |
*/ | |
$rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, “-r”. $params); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment