Você está tendo problemas para enviar e-mails do seu site WordPress?
Por padrão, o WordPress usa a função de correio eletrônico do PHP para enviar e-mails, o que alguns servidores restringem. Uma maneira fácil de resolver isso é enviar e-mails do WordPress usando o servidor SMTP do Gmail.
Neste artigo, mostraremos como enviar e-mails do seu site WordPress usando o servidor SMTP do Gmail.
![Using Gmail SMTP server in WordPress How to use Gmail SMTP in WordPress](https://www.wpbeginner.com/wp-content/uploads/2020/06/how-to-use-gmail-smtp-in-wordpress.png)
Por que e quando você precisa do servidor SMTP do Gmail para e-mails do WordPress
Seu site WordPress envia e-mails para notificá-lo sobre o registro de novos usuários, redefinição de senha perdida, atualizações automáticas e notificações de seus formulários de contato.
Por padrão, o WordPress usa a função de correio do PHP para enviar notificações por e-mail. No entanto, essa função não funciona como esperado devido a vários motivos.
A maioria das empresas de hospedagem WordPress restringe o uso dessa função para evitar abusos e spam.
Os filtros de spam em provedores de serviços de e-mail populares verificam os e-mails recebidos para monitorar se eles são enviados de servidores de e-mail autênticos. Os e-mails padrão do WordPress não passam por essa verificação e, às vezes, podem nem chegar à pasta de spam.
O SMTP (Simple Mail Transfer Protocol) é o padrão do setor para o envio de e-mails. Ao contrário da função de correio eletrônico do PHP, o SMTP usa autenticação adequada, o que aumenta a capacidade de entrega de e-mails.
O Gmail fornece um serviço SMTP que você pode usar para enviar e-mails do seu site WordPress. Se quiser apenas enviar e-mails de notificação do WordPress para si mesmo e para alguns usuários do seu site, os servidores SMTP do Gmail são a melhor opção.
No entanto, se estiver planejando enviar e-mails de boletim informativo usando o WordPress ou se tiver uma loja on-line, deverá usar um provedor de serviços de e-mail em massa, como o Brevo (antigo Sendinblue) ou o Mailgun.
Serviço SMTP do Gmail gratuito vs. pago para WordPress
Você pode usar sua conta gratuita do Gmail para enviar e-mails do WordPress. No entanto, para melhorar a capacidade de entrega, recomendamos o uso do Google Workspace pago.
Com o Google Workspace, você obtém seu próprio endereço de e-mail com marca profissional, como (name@yoursite.com).
O Google Workspace exige que você adicione registros MX ao seu nome de domínio, o que significa que seus e-mails parecerão vir do seu próprio nome de domínio, aumentando a autenticidade e garantindo uma melhor capacidade de entrega.
Usamos o Google Workspace para o WPBeginner e podemos dizer honestamente que é o melhor.
Tutorial em vídeo
Se você preferir instruções por escrito, continue lendo.
Como enviar e-mails do WordPress usando o servidor SMTP do Gmail
Se você decidir usar o Google Workspace, primeiro precisará configurar seu domínio para trabalhar com o Google Apps. Temos um tutorial passo a passo sobre como configurar um endereço de e-mail profissional com o Google Workspace.
O restante das instruções é o mesmo, independentemente de você estar usando uma conta paga ou gratuita do Gmail.
A primeira coisa que você precisa fazer é instalar e ativar o plug-in WP Mail SMTP. Para obter mais detalhes, consulte nosso guia passo a passo sobre como instalar um plug-in do WordPress.
O WP Mail SMTP é o melhor plug-in de SMTP para WordPress do mercado. Ele permite que você use facilmente qualquer servidor SMTP para enviar e-mails do WordPress com maior capacidade de entrega.
Embora exista uma versão gratuita, recomendamos comprar a versão paga, chamada WP Mail SMTP Pro, que lhe dá acesso ao suporte premium, a mais remetentes e a uma configuração de luva branca feita por um de seus especialistas.
Após a ativação, você precisa visitar a página Settings ” WP Mail SMTP para definir as configurações do plug-in. Em seguida, insira sua chave de licença e clique no botão “Verify Key” (Verificar chave). Você pode encontrar a chave na área de sua conta do WP Mail SMTP.
![WP Mail SMTP Settings WP Mail SMTP settings](https://www.wpbeginner.com/wp-content/uploads/2020/06/wp-mail-smtp-settings.png)
Na guia General settings (Configurações gerais), certifique-se de usar seu endereço de e-mail do Gmail no campo “From Email” (Do e-mail).
Em seguida, você precisa fornecer o nome do remetente.
![Enter from email and name Enter from email and name](https://www.wpbeginner.com/wp-content/uploads/2020/06/enter-from-email-and-name.png)
O plugin WP Mail SMTP oferece duas maneiras de conectar seu site WordPress aos servidores do Gmail.
O primeiro método usa a autenticação OAuth. Esse é um método mais seguro para enviar e-mails usando os servidores do Gmail.
O segundo método é inserir as configurações de SMTP do Gmail manualmente. Esse método não é recomendado porque é menos seguro.
Dito isso, vamos configurar o WordPress para usar o SMTP do Gmail para enviar e-mails.
Método 1: Configurar o Gmail para enviar e-mails do WordPress usando o protocolo OAuth
Esse método é recomendado para todos os usuários. Ele é mais seguro e, depois de configurado, você nunca mais precisará fazer isso.
Você precisa começar selecionando “Google/ Gmail” como seu servidor de e-mail.
![Select Gmail and set return path Choose Google as mailer](https://www.wpbeginner.com/wp-content/uploads/2020/06/choose-google-as-mailer.png)
Em seguida, você verá três campos que precisam ser preenchidos ao rolar a tela para baixo.
Basta inserir seu Client ID, Client Secret e Authorized Redirect URI quando estiver lá.
![Client ID and secret fields Client ID and secret fields](https://www.wpbeginner.com/wp-content/uploads/2020/06/client-id-and-secret-fields.png)
Vamos configurar esses campos.
Criação de um aplicativo e geração de chaves de API para o Gmail
Para começar, basta acessar o site do Google Cloud Platform.
Em seguida, clique em “My First Project” (Meu primeiro projeto) na parte superior.
![Create a new Google Developer Console project Click my first project](https://www.wpbeginner.com/wp-content/uploads/2020/06/click-my-first-project.png)
Uma pequena janela pop-up será aberta, na qual você poderá selecionar seus projetos.
Em seguida, clique na opção “New Project” (Novo projeto).
![Create a new project Create a new project](https://www.wpbeginner.com/wp-content/uploads/2020/06/create-a-new-project.png)
Na próxima tela, será solicitado que você forneça um nome para o seu projeto.
Dê a ele um nome memorável para que você possa reconhecê-lo facilmente no futuro.
![Enter project details Enter project details](https://www.wpbeginner.com/wp-content/uploads/2020/06/enter-project-details-1.png)
Depois disso, clique no botão “Create” (Criar) para continuar.
O console do desenvolvedor criará seu projeto e o levará ao painel. O Google oferece aos desenvolvedores acesso a muitas de suas APIs e serviços. Você precisa ativar as APIs de que precisará para este projeto.
![Enable APIs Enable APIs and services](https://www.wpbeginner.com/wp-content/uploads/2020/06/enable-apis-and-services.png)
Clique no botão “Enable APIs and Services” (Ativar APIs e serviços) para continuar.
Isso o levará à página da biblioteca de APIs. Em seguida, você precisa digitar Gmail na caixa de pesquisa para encontrar rapidamente a API do Gmail e clicar para selecioná-la.
![Select Gmail API Select Gmail API](https://www.wpbeginner.com/wp-content/uploads/2020/06/select-gmail-api.png)
Agora você verá uma visão geral da API e o que ela pode fazer.
Basta clicar no botão “Enable” (Ativar) para continuar.
![Enale Gmail API Enable Gmail API](https://www.wpbeginner.com/wp-content/uploads/2020/06/enable-gmail-api.png)
Agora que sua API está ativada, a próxima etapa é criar credenciais que possam ser usadas nas configurações do plug-in SMTP do WP Mail.
Clique no botão “+ Create Credentials” (+ Criar credenciais) para continuar e selecione a opção “Help me choose” (Ajude-me a escolher) no menu suspenso.
![Create credentials Click create credentials](https://www.wpbeginner.com/wp-content/uploads/2020/06/click-create-credentials-1.png)
Na próxima tela, ele perguntará qual API você deseja usar.
Selecione “Gmail API” no menu suspenso de Qual API você está usando.
![Choose Gmail API Choose Gmail API](https://www.wpbeginner.com/wp-content/uploads/2020/06/choose-gmail-api.png)
Depois disso, escolha “User data” (Dados do usuário) para “What data you will be accessing” (Quais dados você acessará).
A partir daí, clique no botão “Next” (Avançar).
![Select user data Select user data](https://www.wpbeginner.com/wp-content/uploads/2020/06/select-user-data.png)
Agora, você precisará inserir as informações do seu aplicativo.
Você pode começar dando um nome ao seu aplicativo, selecionando o endereço de e-mail que forneceu e adicionando um logotipo do aplicativo, se desejar.
![Enter app information Enter app information](https://www.wpbeginner.com/wp-content/uploads/2020/06/enter-app-information.png)
A partir daí, você precisará rolar para baixo e inserir as informações de contato do desenvolvedor.
Depois de inserir o endereço de e-mail, basta clicar no botão “Save and Continue” (Salvar e continuar).
![Enter developer contact information Enter developer contact information](https://www.wpbeginner.com/wp-content/uploads/2020/06/enter-developer-contact-information.png)
Na próxima tela, você pode configurar os “Escopos” da API do Gmail. Essa é uma etapa opcional e você pode ignorá-la por enquanto.
Basta rolar a tela até a parte inferior da página e clicar no botão “Save and Continue” (Salvar e continuar).
![Skip scopes Skip scopes](https://www.wpbeginner.com/wp-content/uploads/2020/06/skip-scopes.png)
Em seguida, insira os detalhes do ID do cliente OAuth.
Comece escolhendo “Aplicativo Web” como o tipo de aplicativo no menu suspenso e, em seguida, insira um nome.
![Select application type Select application type](https://www.wpbeginner.com/wp-content/uploads/2020/06/select-application-type.png)
Ao rolar a tela para baixo, você verá opções para Authorized JavaScript origins. Você pode ignorar essa opção e ir para Authorized Redirect URLs.
Clique no botão “+ Add URL” (+ Adicionar URL) em Authorized redirect URLs (URLs de redirecionamento autorizados) e digite https://connect.wpmailsmtp.com/google/
no campo URLs.
![Add redirect URLs Add redirect URLs](https://www.wpbeginner.com/wp-content/uploads/2020/06/add-redirect-urls-1.png)
Depois de inserir o URL, basta clicar no botão “Create” (Criar).
Em seguida, você verá suas credenciais na área Your Credentials (Suas credenciais).
![Download your credentials Download your credentials](https://www.wpbeginner.com/wp-content/uploads/2020/06/download-your-credentials.png)
Vá em frente e clique no botão Done (Concluído) na parte inferior para prosseguir.
Agora você será levado à página de credenciais do seu projeto. Nessa página, você pode ver as credenciais criadas recentemente listadas aqui. Você precisa clicar no ícone de edição ao lado de suas credenciais para continuar.
![Edit credentials Edit credentials](https://www.wpbeginner.com/wp-content/uploads/2020/06/edit-credentials.png)
Isso o levará à página de edição de credenciais, onde você poderá ver o segredo e o ID do cliente.
Você precisa copiar e colar a chave na página de configurações do plug-in.
![Client secret key Copy client ID and secret](https://www.wpbeginner.com/wp-content/uploads/2020/06/copy-client-id-and-secret.png)
Volte para a página de configurações do plug-in em sua área de administração do WordPress.
Agora que você tem o ID do cliente e as chaves secretas do cliente, é necessário clicar no botão “Save Settings” (Salvar configurações) para continuar.
![Save client credentials in plugin settings Enter client ID and secret in plugin](https://www.wpbeginner.com/wp-content/uploads/2020/06/enter-client-id-and-secret-in-plugin-1.png)
O plug-in agora armazenará suas configurações e recarregará a página.
Depois disso, você precisa rolar para baixo até a parte inferior da página de configurações e clicar no botão “Permitir que o plug-in envie e-mails usando sua conta do Google”.
![Allow plugin to send emails Allow plugin](https://www.wpbeginner.com/wp-content/uploads/2020/06/allow-plugin.png)
Isso o levará à sua conta no Google.
Em seguida, você será solicitado a dar permissão ao site para enviar e-mails em seu nome.
![Allow Gmail Choose Google account](https://www.wpbeginner.com/wp-content/uploads/2020/06/choose-google-account.png)
Basta selecionar sua conta do Gmail e dar permissão para vincular seu projeto de API do Google.
Depois disso, você será redirecionado de volta ao seu site, onde verá uma mensagem de sucesso.
![Connected successfully Connected successfully](https://www.wpbeginner.com/wp-content/uploads/2020/06/connected-successfully.png)
Método 2: Configurar o SMTP do Gmail como remetente SMTP
Esse método permite que você se conecte manualmente aos servidores SMTP do Gmail para enviar seus e-mails do WordPress.
Primeiro, você precisa visitar a página Settings ” WP Mail SMTP para definir as configurações do plug-in.
Comece fornecendo o endereço do Gmail que deseja usar no campo “From Email” e seu nome no campo “From Name”.
![Enter from email and name Enter from email and name](https://www.wpbeginner.com/wp-content/uploads/2020/06/enter-from-email-and-name.png)
Em seguida, você precisa selecionar “Other SMTP” como seu servidor de e-mail.
Além disso, marque a caixa ao lado do caminho de retorno.
![Gmail SMTP Choose Other SMTP as mailer](https://www.wpbeginner.com/wp-content/uploads/2020/06/choose-other-smtp-mailer.png)
Depois disso, role para baixo até a seção Other SMTP.
É aqui que definiremos mais configurações para nos conectarmos aos servidores SMTP do Gmail.
![Gmail SMTP settings for WP Mail SMTP plugin Configure other SMTP](https://www.wpbeginner.com/wp-content/uploads/2020/06/configure-other-smtp-1.png)
Aqui está a configuração exata que você precisa adicionar às configurações do plug-in:
- Host SMTP: smtp.gmail.com
- Criptografia: Use a criptografia SSL
- Porta SMTP: 465 (isso deve aparecer automaticamente quando você selecionar a criptografia SSL)
- Auto TLS: Desative o TLS
- Autenticação: Ativar a autenticação
- Nome de usuário SMTP: Seu endereço completo do Gmail, por exemplo, john.smith@yourdomain.com ou john.smith@gmail.com
- Senha SMTP: Senha de sua conta do Gmail
Quando terminar, clique no botão salvar alterações para armazenar suas configurações.
![Save settings for other SMTP Save settings for other SMTP](https://www.wpbeginner.com/wp-content/uploads/2020/06/save-settings-for-other-smtp.png)
Isso é tudo; você configurou com êxito o WP Mail SMTP para usar os servidores SMTP do Gmail.
Observação: se você usar o método 2, saiba que ele é menos seguro porque sua senha é armazenada em texto. Você pode melhorar isso usando a dica constante, mas recomendamos enfaticamente o uso do Método 1.
Testando suas configurações de SMTP do WP Mail
O plug-in WP Mail SMTP permite testar suas configurações de e-mail para que você possa ter certeza de que tudo está funcionando corretamente.
Você precisa visitar a página Settings ” WP Mail SMTP e clicar na guia “Email Test” (Teste de e-mail). Basta fornecer um endereço de e-mail que você possa acessar no campo “Send To” (Enviar para) e clicar no botão Send Email (Enviar e-mail).
![Send test email Send test email](https://www.wpbeginner.com/wp-content/uploads/2020/06/send-test-email.png)
Você verá uma mensagem de sucesso. Agora você pode verificar sua caixa de entrada e ver uma mensagem com o assunto “WP Mail SMTP: Testar e-mail para…”.
Isso é tudo; você configurou com êxito seu site WordPress para enviar e-mails usando os servidores SMTP do Gmail.
Obtenha mais com o WP Mail SMTP Pro
Se você quiser ainda mais funcionalidade, experimente o WP Mail SMTP Pro.
Com a versão Pro do plug-in, você pode se conectar com:
- Espaço de trabalho do Google/Gmail
- Amazon SES
- Pistola de correio
- Office 365 / Outlook.com
- SendGrid
- E mais
Você também obtém recursos adicionais, como registros de e-mail, a capacidade de ajustar/controlar a notificação que o seu site WordPress envia e muito mais.
Solução de problemas de SMTP do Gmail que não funciona
Observamos que os usuários encontraram alguns problemas ao usar o SMTP do Gmail com determinadas configurações de hospedagem compartilhada.
Siga as etapas a seguir para corrigir o problema de SMTP do Gmail:
Faça login na sua conta cPanel. Em seguida, localize o botão “+ Create” na página de contas de e-mail.
![create-email-account-in-cpanel create email account in cpanel](https://www.wpbeginner.com/wp-content/uploads/2020/06/create-email-account-in-cpanel.png)
A partir daí, você pode criar uma conta de e-mail que corresponda ao seu endereço de e-mail do Google Apps.
Ao criar a conta de e-mail, você está basicamente tornando o servidor de hospedagem ciente de um endereço de e-mail que deve enviar e-mails. Essa etapa é uma solução alternativa para convencer o servidor de que você está enviando e-mails por meio dele, mesmo que planeje usar o servidor SMTP do Gmail.
![create-an-email-account create an email account](https://www.wpbeginner.com/wp-content/uploads/2020/06/create-an-email-account.png)
Isso pode parecer estranho porque você não está usando seu servidor para e-mails. Essa etapa basicamente engana o servidor, fazendo-o acreditar que você está enviando o e-mail pelo servidor.
Na sua conta do cPanel, acesse os registros MX e altere o roteamento MX de automático para remoto. Pode ser um pouco difícil de encontrar, pois cada host agora tem uma interface cPanel personalizada.
Você precisa procurar um pequeno link ao lado de MX que diz Roteamento de e-mail: Remote Mail Exchanger. Você pode seguir nosso guia sobre como alterar os registros MX do seu site WordPress com base no seu serviço de hospedagem.
Depois disso, faça login novamente em seu site WordPress e envie um e-mail de teste.
Esperamos que este artigo tenha ajudado você a aprender como enviar e-mails no WordPress usando o servidor SMTP do Gmail. Talvez você também queira ver nossa lista dos melhores plug-ins de formulário de contato para WordPress e nossa comparação dos melhores serviços de marketing por e-mail para pequenas empresas.
Se você gostou deste artigo, inscreva-se em nosso canal do YouTube para receber tutoriais em vídeo sobre o WordPress. Você também pode nos encontrar no Twitter e no Facebook.
Syed Balkhi says
Hey WPBeginner readers,
Did you know you can win exciting prizes by commenting on WPBeginner?
Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
You can get more details about the contest from here.
Start sharing your thoughts below to stand a chance to win!
David says
Hi, I used this tutorial last year to install and configure the Gmail SMTP plugin. Until very recently, the Gmail SMTP plugin in conjunction with my website’s contact form worked perfectly. But I tested my website’s contact form today, and I got the following fatal-error message:
Fatal error: Uncaught exception ‘Google_Auth_Exception’ with message ‘Error refreshing the OAuth2 token, message: ‘{ “error” : “invalid_grant” }”
I don’t have a clue what that means. I get the same fatal-error message when I use the plugin to send a test message at Gmail SMTP plugin>Settings>Test email.
I haven’t changed any of the plugin settings since I first installed it a year ago, and I haven’t done anything new with my Google Console account either. I’m using the most recent version of the Gmail SMTP plugin, and also the newest version of WordPress.
Any ideas or suggestions?
Thanks!
WPBeginner Support says
Hey David,
It seems like your Oauth2 token has expired. Try following the tutorial again from the beginning to set it up again.
Administrador
Ehsan says
Thank U very much – one of my problem was this “my emails goes to spam folder”
with this service(Method 1) Now It’s great – of course after 14 days you must pay for that but still it’s prefect
I have question;
Can I send 100 Emails like newsletter for my customer is it OK for Google!?
I afraid my Emails after it goes to spam folder again
Sharon says
I did everything as described, but the contact form on my website still does not work.
Adondriel says
Hey, add a thing at the end for the troubleshooting thing: “Check with your website host and verify that they do not block outgoing requests by default.” I know 1. GoDaddy does this, and won’t let you unblock. and 2. Namecheap also blocks by default but you just gotta contact support, give em your info and ask em to unblock port 587 and boom, it’ll all work again.
Lucas says
You save my life!
Tks!
adam says
i keep getting a Error: redirect_uri_mismatch when i press ‘grant permission’. It’s driving me nuts as I can’t work out what is wrong? Everything seems to match.
Adam
Grzegorz says
Same here. i get redirect_uri_mismatch
Macky says
This video has been a fantastic help.
I’m a complete WordPress beginner.The step-by step instructions are very easy to follow. Now my emails are working perfectly!! Plus I also learnt how to insert headers & footers with ease.
Thanks once again!!
WPBeginner Support says
Hi Macky,
We are glad you found the video helpful. You may also want to subscribe to our YouTube Channel for WordPress video tutorials.
Administrador
Fabio says
Your tutorial saved my site! Thank you very much mate!
Maggie Z says
A follow-up question – because of the login conflict issue, I was also considering using WP Mail SMTP. However, many users on the support forum for that plugin express concern that the password for the email account is visible on the admin page in plain text.
I have a firewall set up that prevents non-admins from getting in to the back end, so is there any real security concern regarding the password showing in plain text? Any advice much appreciated!!!
Maggie Z says
After troubleshooting quite a bit, I finally relented and went with WP Mail SMTP, which requires the “allow less secure apps” solution – a tech support person at G Suite told me that it was safe, and it seems like the only way to go for my particular setup. Appears to be working now. Thanks for the incredibly clear instructions!!! I am now a firm fan of this site.
Maggie Zellner says
The video is fantastic, and the plugin installed perfectly. Unfortunately I didn’t realize until after I went through the whole process (because I didn’t read the documentation on the plugin carefully), the Gmail SMTP plugin eliminates the need for users to log in, and therefore it interfered with the login process that we have instituted for paid members on our website (which we manage through a plugin called PaidMembershipsPro).
Is there any way to disable that aspect of this plugin, so I can send all email via our Gmail account, but can still have users log in and out?
Eric says
Great article! However, I am unclear on something when using WordPress for sending newsletters. What is the difference between those mass emailing service providers (mailgun & Sendgrid) and using Google Apps for work SMTP?
Can’t we use Google Apps for work to send newsletters just as well?
WPBeginner Support says
with Google Apps for Work, you can only send an email to 500 recipients max (for paid business accounts). You cannot use it for newsletters.
Administrador
Eric says
Thanks so much for your response! With Google Apps for Work only limiting to 500 recipients, then I suppose it would work if we sent it to 500 or less people.
My next question, is it max to send all at one time or per day? If we throttle it to only send out a few per minute, do you know if it would allow it to send thousands within a few hours?
Heather says
Thank you so much! This was so helpful!
zim ejin says
Hi, this was very informative thank you for posting. however i have a website hosted on aws ec2, and route53 for dns. i tried the secure configuration. it didn’t work. Is there a special configuration for self hosted websites on aws ec2/route53. btw : i don’t have a cpanel installed.
Lanrz says
After granting access and clicking on the allow button, I was not being redirected back to wordpress and the SMTP status is still not connected.
Any advice on how I should go about doing it?
Thanks!
Nathalie says
Doesn’t work: test email retuens Connection: opening to smtp.gmail.com:587, timeout=300, options=array ( ‘ssl’ => array ( ‘verify_peer’ => false, ‘verify_peer_name’ => false, ‘allow_self_signed’ => true, ),)
I checked Email Routing -> Remote Mail Exchanger but it didn’t help
Raph Divine says
Thanks for the write-up. It really helped me! 5stars!
Real Name says
This guide worked wonderfully until my server stopped sending emails and I can’t get it to work again. The “Test Email” tab doesn’t make it clear if the email has successfully sent or not since it just spews out 52 lines that don’t mean much to me. :/
Boro says
Amazing Tutorial !!!!
Thank you
peter says
Ok, so I have followed the OAuth instructions and my SMPT status button has gone green. However, whether through test email or my site, I can not send an email through the contact us form (pluggin contact form builder by web Durado). The hanging message say waiting for and eventually I get a 405 error notice.
Any thoughts.
Thomas says
Hoping you can help me?
I tried setting up method 1 using gmail and I got the ‘green light’ from wordpress however when testing the email I receive the following error message after waiting 1 minute for it to send:
Connection: opening to smtp.gmail.com:587, timeout=300, options=array ()
Any ideas on how to fix this?
Very best,
Tom
Fernando Santos says
This tutorial is awesome!
I have one question, though. I directed the contact form messages to a gmail group email address, but, for some reason, the messages aren’t being delivered. When I direct to a “real” e-mail address like the messages are normally delivered.
I would really appreciate if someone could give me a hand figuring out why this happens.
Thank you!!!
Paul says
+1 for this question. Have exactly the same question as wish to use our info@.. address
Andres says
Thanks guys for such useful article. I followed all the steps and was able to configure the email correctly. However, when I receive the email from mydomain.com address (sent by wordpress after purchasing a product), the user avatar (gmail picture) doesn’t appear even though mydomain.com has a picture already.
In fact, if I send an email directly from mydomain.com account via google for work, the receiver is able to see the image right away, but it’s not the case if the email is sent via wordpress.
Do you have any suggestions? Thanks a lot, and keep rocking!
Sahar says
Thanks for this helpful information. You really helped me out in setting this up, and I appreciate you taking the time to create this useful information!
WPBeginner Support says
Glad you found it helpful.![:)](https://www.wpbeginner.com/pt/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Administrador
lokesh kumar CL says
What is origin URI of the client application. its not accepting website URL ….please help me out
Susan says
Excellent instructions and thanks for walking me through setting this up. I did try the MX record change but no luck there either.
I get a 405 Not allowed message when I try to send an email.
I am hosted by Bluehost and am using the DIVI theme.
If anyone has any ideas I would be very grateful.
Leista says
Hello, having a similar issue. Getting a 405 error, and also hosted on Bluehost. By any chance, were you able to fix the problem? Thanks.
JDC says
I had the same problem with bluehost. But this gave me the solution.
I uninstalled any extra plugin for mail, including smtp mailer or gmail smtp plugin and just used a random address like mynewaddress@example.com (replace example.com with your own domain name) and it worked. I sent an email to my gmail account I it passes all the filters. It seems that BlueHost validates the address if it is comming from the server that hosts that domain. In gmail you usually get a warning that says that this email might not have being validated, but my email are comming fine with custom wordpress email functions. No extra plugin needed.
Prashant Bhandarkar says
Thank you so much. This was of great help. God Bless you!![:)](https://www.wpbeginner.com/pt/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Karmen says
Awesome tutorial!!!
Louise says
I have this working brilliantly with a Google apps for work account for a woocommerce solution on wordpress, thank you.
Should this work if I use a Google group mail instead of an account?
Thanks very much.
Brian Treiber says
I am not using Google apps for work, I have everything set up and connected. I tried to send a test email however I get a 405 not allowed error. I went into my cpanel and changed the mx records to the recommended” remote.” Still can’t send. Does this mean I need to use the less secure method?
Jason North says
I’m getting this error when I try to activate the plugin:
Plugin could not be activated because it triggered a fatal error. Parse error: syntax error, unexpected T_FUNCTION, expecting ‘)’ in /home3/north23/public_html/forcebrain/wp-content/plugins/gmail-smtp/google-api-php-client/src/Google/autoload.php on line 19
genie says
Hello, I use gmail-smtp plugin but it conflict with ultimate membership. Could you help me ?
I try another wp mail smtp but in the last feld: user account pass. Google app not allow to login from plugin. Pls help
Thank you
Leslie Andrews says
Clearly I’m doing something wrong. When I get to “add credentials” I’m getting this error message and can’t move forward.
Invalid Redirect: must end with a public top-level domain (such as .com or .org)
Any help would be great
WPBeginner Support says
If you look at the URL closely, you will notice that you are missing a . between domainname and the TLD, yours is examplecom when it should be example.com.
Administrador
Graham says
Thanks for the tutorial, but I get this error when I try to send a test email:
Connection: opening to ssl://smtp.gmail.com:587, timeout=300, options=array ()
SMTP ERROR: Failed to connect to server: Connection refused (111)
SMTP connect() failed.
Does it have something to with my site being secured with SSL?
Tony says
I’m having the same issue. Did you figure it out?
Tom says
Nice Article, I’m having a few issues to get this working. So I Deactivated the Plugin and tested a Contact Form to see if all was the same before setting up Gmail SMTP, unfotunately No Emails are being sent through now.
Even though the Gmail SMTP Plugin is NOT active, do we need to reset back to the default settings somehow?
WPBeginner Support says
Nope simply deactivating it would turn it off.
Administrador
Jenny says
Hi,
I have this all set up properly and the test email worked…I just commented on my own blog to see if I would get an email when a comment was posted but I unfortunately didn’t. Can someone help me figure out where I went wrong?
Sachin says
Hey thanks for the tutorial. Everything works fine in Setup, but when mail is being sent the site freezes for about 5 mins. site doesnt open at that time. It doesnt respond at that time. Any idea what might be causing this issue. But the point is mail is sent at last finally
WPBeginner Support says
Please contact your WordPress hosting provider. They may be able to help you better.
Administrador
crissy says
Hi,
I’m having problem with the test email send
Fatal error: Cannot redeclare class phpmailer in /home/mywebsite/wp-includes/class-phpmailer.php on line 29
please help
David says
Hi, I just installed this plugin, and everything went perfectly–thanks to your excellent tutorial! (I definitely couldn’t have done it without you.) My website’s outgoing email immediately started landing in people’s inboxes rather than in their spam folders.
But since I’m a novice at these matters and don’t know SMTP from RSVP, I did some reading on SMTP, and on one website I came across made this statement:
“Another strategy that hackers use: If your app sends email using SMTP, the IP address will be recorded in the Received header lines. Either scrub the original Received line [no explanation provided of how that’s done], or don’t use SMTP for email submission.”
Is this something I should be concerned about security-wise? Or does this plugin solve this problem somehow? And if not, how should I fix it?
Thanks!
WPBeginner Support says
You shouldn’t be concerned about it. Most popular email service providers and their spam filters can check if an email is originating from the IP address it claims to be coming from.
Administrador
Rob says
Thank YOU so much for this!! I’ll keep coming back for more!!![:)](https://www.wpbeginner.com/pt/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Travis says
Thanks so much for this tutorial.
Originally I had this all setup and working fine, but I moved my website and did some other fixes to it, and suddenly mailing stopped working.
Previously I spent some time trying to set it up and get it to work, but then it “stopped” working randomly.
Anyways, option #1 really saved me a major headache.
Christine Tabor says
I configured, and got the green go to go button… THANKS FOR THE STEP BY STEP…
(doing this on a client test site)…
BUT REGARDING GRAVITY FORMS (or any form plug in)… do I also need to change up the notification emails that I’ve used for the Gravity Forms submissions?
Is it ok for the “from” email I used in the configuration to be different than the gmail used to set i up?
The issue that started all this was client not getting his Gravity Form notifications.
SO, before I install on their live site… (which is ecommerce and SSL)… can you reply to this … and should I still use the TSL for the configuration? I wasn’t sure if a certificate on the site made any difference in configuring this.
Thanks,
Christine
WPBeginner Support says
No you don’t need to change notification emails.
It is OK, but to ensure maximum deliverability you should use the email address that is actually sending the email.
You should try with SSL first for the Gmail Configuration.
Administrador
Christine says
Thanks for reply…little bit more clarification please.
I set up an email…info@domain.com as a forwarder in cpanel, and I forward to their Verizon email.
I left the Verizon email in the GF notification list, added the info email, and another alternate email.
So the info email is the one in Gmail plugin set up that is sending the email…is it ok that it’s a forwarder?
Also, when I set up the plugin, I used a gmail I had created … CompanyName@gmail.com
But not using it as the sending email or anywhere else.
I sent a test and it appears all worked… Should I go back and change to SSL instead of the TSL or leave as is?
Thanks again…
Christine
WPBeginner Support says
Sounds about right. However, if it was up to us we would use the Gmail address as the sender and add the forwarding email address as the Reply-to address.
Tribhuwan Bhatt says
Thank You
Tim R says
Doesn’t work for me on April 14, 2016.
Things I do rarely work.
Connection: opening to smtp.gmail.com:587, timeout=300, options=array ()
SMTP ERROR: Failed to connect to server: Network is unreachable (101)
SMTP connect() failed.
Mailer Error: SMTP connect() failed.
Any point in fussing with this ?
zse says
Hi,
I have this same error.
Did you solved this problem?
Regards![;)](https://www.wpbeginner.com/pt/wp-content/plugins/classic-smilies/img/icon_wink.gif)
Tim R says
Here’s a follow up:
Settings of my web host’s server made this impossible.
Switched hosts and now it works easy as pie.
Don’t forget to change settings on gmail account to allow for unregistered apps (a search will discover many instructions to do that so I won’t add it here)
Monica says
Hey i tried allowing access for unregistered apps it still doesnt work for me.
I am getting the error:
Connection: opening to smtp.gmail.com:587, timeout=300, options=array ()
SMTP ERROR: Failed to connect to server: Connection refused (111)
SMTP connect() failed.
Any ideas ?
Bclose says
Hi ,![:-)](https://www.wpbeginner.com/pt/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Thanks for this ticket ..i was fighting with my emial provider weblayer and nothing. it worked with your magic touch , one simple note .. by the end of Ouauth when explaining to create a fake local email you forgot to include that we must use MX record and what is is , i search on google and found ALT2.ASPMX.L.GOOGLE.COM, but this last simply thing could be a danwfault for all readers
Either way thank you..a lot!
Kay says
Thank you soooooo much for this! Worked like a charm. The instructions are 100% on point!
Tyler says
Anyone get this working with google apps email? I’ve created API credentials. SMTP status is green. But Test email says connection refused. Already set mx to remote on godaddy. Are there any security setting ls in google apps email that have to be configured?
TJ says
Nice article, was able to install the plugin and it sent the email from the plugin test email.
Fails when using Contact Form 7, any recommendations for a contact form plugin that this might work with?
Thanks
WPBeginner Support says
You can try it with WPForms.
Administrador
Muhammad says
thanks for the nice post.i was thinking to set up this for my site.
Ripul says
Interesting, however I am getting this error : “Error: redirect_uri_mismatch”
Ripul says
I forgot to mention I am testing this on Localhost.
Rashmirekha Moharana says
Hi Syed.
Thanks a lot for such a wonderful solution. Let me implement and see.
Kudos to you.