Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
Copa WPB
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Como enviar e-mails no WordPress usando o servidor SMTP do Gmail

Nota editorial: Ganhamos uma comissão de links de parceiros no WPBeginner. As comissões não afetam as opiniões ou avaliações de nossos editores. Saiba mais sobre Processo editorial.

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.

How to use Gmail SMTP in WordPress

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

Subscribe to WPBeginner

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

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

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.

Choose Google as mailer

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

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.

Click my first project

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

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

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 and services

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

Agora você verá uma visão geral da API e o que ela pode fazer.

Basta clicar no botão “Enable” (Ativar) para continuar.

Enable Gmail API

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.

Click create credentials

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

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

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

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

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

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

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

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

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

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.

Copy client ID and secret

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.

Enter client ID and secret in plugin

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

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.

Choose Google account

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

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

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.

Choose Other SMTP as mailer

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.

Configure other SMTP

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

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

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

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

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.

Divulgação: Nosso conteúdo é apoiado pelo leitor. Isso significa que, se você clicar em alguns de nossos links, poderemos receber uma comissão. Veja como o WPBeginner é financiado, por que isso é importante e como você pode nos apoiar. Aqui está nosso processo editorial.

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

O kit de ferramentas definitivo WordPress

Obtenha acesso GRATUITO ao nosso kit de ferramentas - uma coleção de produtos e recursos relacionados ao WordPress que todo profissional deve ter!

Reader Interactions

134 ComentáriosDeixe uma resposta

  1. 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!

  2. 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!

  3. 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

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

  5. 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

  6. 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!!

  7. 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.

  8. 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?

  9. 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?

    • 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?

  10. 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.

  11. 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!

  12. 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

  13. 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. :/

  14. 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.

  15. 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

  16. 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!!!

  17. 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!

  18. 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!

  19. 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.

  20. 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.

  21. 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?

  22. 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

  23. 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

  24. 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

  25. 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?

  26. 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?

  27. 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?

  28. 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

  29. 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

  30. 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

  31. 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.

  32. 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

  33. 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 ?

    • 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 ?

  34. Bclose says

    Hi ,
    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!

  35. 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?

  36. 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

Deixe uma resposta

Obrigado por deixar um comentário. Lembre-se de que todos os comentários são moderados de acordo com nossos política de comentários, e seu endereço de e-mail NÃO será publicado. NÃO use palavras-chave no campo do nome. Vamos ter uma conversa pessoal e significativa.