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

Så här skickar du email i WordPress med hjälp av Gmail SMTP Server

Har du problem med att skicka emails från din WordPress site?

Som standard använder WordPress PHP:s mailfunktion för att skicka email, vilket vissa servrar begränsar. Ett enkelt sätt att lösa detta är att skicka email från WordPress med Gmails SMTP-server.

I den här artikeln visar vi hur du skickar email från din WordPress site med hjälp av Gmail SMTP-server.

How to use Gmail SMTP in WordPress

Varför och när du behöver Gmail SMTP Server för WordPress Emails

Din WordPress site skickar email för att meddela you om registrering av nya användare, återställning av förlorat password, automatiska updates och notifications från dina kontaktformulär.

Som standard använder WordPress PHP:s mail-funktion för att skicka ut aviseringar via email. Denna funktion fungerar dock inte som förväntat på grund av ett antal anledningar.

De flesta WordPress webbhotell begränsar användningen av denna funktion för att förhindra missbruk och skräppost.

Skräppostfilter på populära mail provider kontrollerar inkommande email för att övervaka om de skickas från autentiserade mail servrar. Standard WordPress emails klarar inte denna kontroll och ibland kanske de inte ens hamnar i skräppostens folder.

SMTP (Simple Mail Transfer Protocol) är industristandarden för sending av email. Till skillnad från PHP:s mailfunktion använder SMTP korrekt autentisering, vilket ökar email deliverability.

Gmail tillhandahåller en SMTP-tjänst som du kan använda för att skicka ut email från din WordPress site. Om du bara vill skicka notifikationer från WordPress till dig själv och några användare på din site är Gmails SMTP-servrar det bästa alternativet.

Men om du har planer på att skicka nyhetsbrev med WordPress eller om du har en butik på nätet bör du använda en tjänst för massutskick av e-post, som Brevo (tidigare Sendinblue) eller Mailgun.

Gratis vs. betald Gmail SMTP-tjänst för WordPress

Du kan använda ditt gratis Gmail account för att skicka ut WordPress emails. För bättre deliverability rekommenderar vi dock att du använder betalda Google Workspace.

Med Google Workspace får du din egen professionella email address, till exempel (name@yoursite.com).

Google Workspace kräver att du lägger till MX-poster till ditt domännamn, vilket innebär att dina e-postmeddelanden ser ut att komma från ditt eget domännamn, vilket ökar autentiseringen och säkerställer bättre deliverability.

Vi använder Google Workspace för WPBeginner och kan ärligt säga att det är det bästa.

Video Tutorial

Subscribe to WPBeginner

Om du föredrar skriftliga instruktioner är det bara att fortsätta läsa.

Hur man skickar email till WordPress med hjälp av Gmail SMTP Server

Om du väljer att använda Google Workspace måste du först konfigurera din domän så att den fungerar med Google Apps. Vi har en Step-by-Step tutorial om hur du ställer in en professionell email address med Google Workspace.

Resten av instruktionerna är desamma om du använder ett betalt eller gratis Gmail account.

Det första du behöver göra är att installera och aktivera pluginet WP Mail SMTP. För mer detaljer, se vår Step-by-Step guide om hur du installerar ett plugin för WordPress.

WP Mail SMTP är det bästa SMTP-tillägget för WordPress på marknaden. Det allow you att enkelt använda vilken SMTP-server som helst för att skicka WordPress email med högre deliverability.

Det finns en gratis version, men vi rekommenderar att du köper betalversionen som heter WP Mail SMTP Pro, som ger dig tillgång till premium support, fler mailers och en white glove-installation av en av deras experter.

Efter aktivering måste du besöka Settings ” WP Mail SMTP page för att konfigurera plugin-inställningarna. Sedan enter du din license key och clickar på knappen ”Verify Key”. Du kan hitta nyckeln i ditt WP Mail SMTP account area.

WP Mail SMTP settings

Under tabben Allmänna inställningar måste du se till att du använder din Gmail email address i fältet ”From Email”.

Därefter måste du ange avsändarens namn.

Enter from email and name

WP Mail SMTP plugin erbjuder två sätt att ansluta din WordPress site till Gmail servrar.

Den första metoden använder OAuth autentisering. Detta är en säkrare metod för att skicka email med hjälp av Gmails servrar.

Den andra metoden är att enter Gmail SMTP settings manuellt. Den här metoden rekommenderas ej eftersom den är mindre säker.

Med detta sagt, låt oss ställa in WordPress så att det använder Gmail SMTP för att skicka email.

Metod 1: Ställa in Gmail för att skicka WordPress Emails med OAuth-protokoll

Den här metoden rekommenderas för alla användare. Den är säkrare, och när du väl har ställt in den behöver du aldrig göra det igen.

Du måste börja med att välja ”Google/ Gmail” som din mailer.

Choose Google as mailer

Därefter ser du tre fält som du måste fylla i när du rullar ner.

Enter bara ditt Client ID, Client Secret och Authorized Redirect URI när du är där.

Client ID and secret fields

Låt oss ställa in dessa fält.

Skapa en app och generera API Keys för Gmail

För att börja besöker du helt enkelt Googles Cloud Platform website.

Klicka sedan på ”My First Project” högst upp.

Click my first project

Ett litet popup-fönster öppnas där du kan välja dina projekt.

Gå vidare och klicka på alternativet ”Nytt projekt”.

Create a new project

På nästa vy ombeds du att ange ett namn för your projekt.

Ge den ett minnesvärt namn så att you lätt kan känna igen den i framtiden.

Enter project details

Därefter klickar du på knappen ”Skapa” för att fortsätta.

Konsolen för utvecklare kommer nu att skapa ditt projekt och ta dig till dess dashboard. Google erbjuder utvecklare tillgång till många av sina API:er och tjänster. Du måste aktivera de API:er som du kommer att behöva för det här projektet.

Enable APIs and services

Klicka på knappen ”Aktivera API:er och tjänster” för att fortsätta.

Detta tar dig till API-bibliotekets page. Därefter måste du skriva Gmail i search boxen för att snabbt hitta Gmail API och click för att välja det.

Select Gmail API

You will now see an overview of the API and what it can do.

Klicka bara på knappen ”Aktivera” för att fortsätta.

Enable Gmail API

Nu när ditt API är aktiverat är nästa steg att skapa credentials som du kan använda i dina WP Mail SMTP plugin-inställningar.

Klicka på knappen ”+ Create Credentials” för att fortsätta och välj alternativet ”Help me choose” i dropdown-menyn.

Click create credentials

På nästa vy får du frågan om vilket API du vill använda.

Välj ”Gmail API” i dropdown-menyn för vilket API du använder.

Choose Gmail API

Därefter väljer du ”User data” för vilka uppgifter du kommer att få tillgång till.

Därefter klickar du på knappen ”Next”.

Select user data

Nu måste du enter informationen om din app.

Du kan börja med att ge din app ett namn, välja den email address du angav och lägga till en logga om du vill.

Enter app information

Därifrån måste du rulla ner och enter utvecklarens kontaktinformation.

När du har enter email addressen klickar du bara på knappen ”Save and Continue”.

Enter developer contact information

På nästa vy kan du konfigurera ”Scopes” för Gmail API. Detta är ett valfritt steg, och du kan hoppa över det för tillfället.

Rulla bara ner längst ner på page och click the ”Save and Continue” button.

Skip scopes

Därefter går du vidare och enter details för OAuth Client ID.

Börja med att välja ”Web Application” som Application Type i dropdown-menyn och enter sedan ett namn.

Select application type

När du rullar ner ser du alternativ för Auktoriserade JavaScript-ursprung. Du kan hoppa över detta och heada över till Authorized Redirect URLs.

Gå vidare och klicka på knappen ”+ Add URL” under Auktoriserade redirect-URL: er och ange https://connect.wpmailsmtp.com/google/ under URL-fältet.

Add redirect URLs

När du har enter URL:en klickar du bara på knappen ”Create”.

Därefter ser du dina credentials under Your Credentials area.

Download your credentials

Gå vidare och klicka på knappen Done längst ner för att gå vidare.

You will now be taken to your project’s credentials page. På den här sidan kan du se dina senaste credentials listade här. You need to click on the edit icon next to your credentials to continue.

Edit credentials

Då kommer du till sidan edit credentials, där du kan se din client secret och client ID:n.

You need to copy and paste the key into your plugin’s settings page.

Copy client ID and secret

Gå tillbaka till sidan med inställningar för pluginet i WordPress admin area.

Nu när du har både klient-ID:n och klientens secret keys måste du klicka på knappen ”Save Settings” för att fortsätta.

Enter client ID and secret in plugin

Pluginet kommer nu att lagra dina settings och ladda om page.

Efter det måste du rulla ner längst ner på sidan med inställningar och klicka på knappen ”Allow plugin to send emails using your Google account”.

Allow plugin

Detta kommer att ta dig till ditt account på Google.

Sedan kommer du att bli ombedd att ge webbplatsen behörighet att skicka email för din räkning.

Choose Google account

Välj bara ditt Gmail account och ge behörighet att länka ditt Google API-projekt.

Efter det kommer du att redirectas tillbaka till din website, där du kommer att se ett success message.

Connected successfully

Metod 2: Setting up Gmail SMTP as SMTP Sender

Denna metod allow you att manuellt ansluta till Gmails SMTP-servrar för att skicka your WordPress emails.

Först måste du besöka Settings ” WP Mail SMTP page för att konfigurera plugin-inställningarna.

Börja med att ange den Gmail-adress som du vill använda i fältet ”From Email” och ditt namn i fältet ”From Name”.

Enter from email and name

Därefter måste du välja ”Other SMTP” som din mailer.

Kontrollera också boxen bredvid return path.

Choose Other SMTP as mailer

Därefter rullar du ner till Other SMTP section.

Det är här vi ska konfigurera fler inställningar för att ansluta till Gmails SMTP-servrar.

Configure other SMTP

Här är den exakta konfigurationen du behöver add to inställningarna för plugin:

  • SMTP.com server: smtp.gmail.com
  • Encryption (kryptering): Använd SSL Encryption
  • SMTP-port: 465 (detta ska visas automatiskt när du väljer SSL-kryptering)
  • Auto TLS: Stäng av TLS
  • Autentisering: Slå på autentisering
  • SMTP.com användarnamn: Din fullständiga Gmail-adress, t.ex. john.smith@yourdomain.com eller john.smith@gmail.com
  • SMTP Password: Password för ditt Gmail account

När du är klar klickar du på knappen save changes för att lagra dina settings.

Save settings for other SMTP

Det är all; you have successfully set up WP Mail SMTP to use Gmail SMTP servers.

Obs/observera: Om du använder metod två ska du veta att den är mindre säker eftersom ditt password lagras i text. Du kan förbättra detta genom att använda det konstanta tipset, men vi rekommenderar starkt att du använder metod 1.

Testa dina WP Mail SMTP Settings

WP Mail SMTP plugin allow you att testa dina email settings så att du kan se till att allt fungerar som det ska.

Du måste gå till Settings ” WP Mail SMTP page och click on the ’Email Test’ tabs. Ange en email address som du kan komma åt i fältet ”Send To” och klicka på knappen ”Send Email”.

Send test email

Du kommer att se ett success message. You can now check your inbox to see a message with the subject line ’WP Mail SMTP: Test Email to…’.

Det var allt, du har utan problem konfigurerat din WordPress site för att skicka email med Gmail SMTP servrar.

Få ut mer med WP Mail SMTP Pro

Om du vill ha ännu mer funktionalitet bör du prova WP Mail SMTP Pro.

Med Pro-versionen av plugin kan du ansluta dig till:

  • Googles arbetsyta/Gmail
  • Amazon SES
  • Mailgun
  • Office 365 / Outlook.com
  • SendGrid
  • Och mer

Du får också ytterligare funktioner som gillar email loggar, möjligheten att finjustera/kontrollera vilken notification din WordPress site skickar, och mer.

Felsökning av Gmail SMTP fungerar inte Issues

Vi har sett användare stöta på några issues när de använder Gmail SMTP med vissa konfigurationer av delade webbhotell.

Följ följande steg för att fixa Gmail SMTP-problemet:

Logga in på ditt cPanel account. Därefter hittar du knappen ”+ Create” på sidan email accounts.

create email account in cpanel

Därifrån kan du skapa ett email address som matchar din Google Apps email address.

Genom att skapa e-postkontot gör du i princip servern på webbhotellet medveten om att det finns en email address som ska skicka e-post. Detta steg är en lösning för att övertyga servern om att du skickar email via den, även om du har planer på att använda Gmails SMTP-server.

create an email account

Detta kan verka konstigt eftersom du ej använder din server för email. Detta steg lurar i princip din server att tro att du skickar email via servern.

I your cPanel account, go to the MX Records and change the MX routing from automatic to remote. Det kan vara lite knepigt att hitta eftersom varje server nu har ett customize cPanel-gränssnitt.

Du måste leta efter en liten länk bredvid MX där det står Email Routing: Fjärrutbytare för e-post. Du kan följa vår guide om hur du ändrar MX-poster för din WordPress site baserat på din webbhotell tjänst.

Efter det loggar du in på din site WordPress och skickar ett test email.

Vi hoppas att den här artikeln hjälpte dig att lära dig hur du skickar email i WordPress med hjälp av Gmail SMTP-servern. Du kanske också vill se vår lista över de bästa tilläggen för kontaktformulär för WordPress och vår jämförelse av de bästa tjänsterna för e-postmarknadsföring för småföretag.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Avslöjande: Vårt innehåll stöds av våra läsare. Det innebär att om du klickar på några av våra länkar, kan vi tjäna en provision. Se hur WPBeginner finansieras, varför det är viktigt, och hur du kan stödja oss. Här är vår editoriala process.

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.

Den ultimata WordPress-verktygslådan

Få GRATIS tillgång till vår verktygslåda - en samling WordPress-relaterade produkter och resurser som varje professionell användare bör ha!

Reader Interactions

134 kommentarerLämna ett svar

  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. lokesh kumar CL says

    What is origin URI of the client application. its not accepting website URL ….please help me out

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

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

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

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

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

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

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

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

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

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

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

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

      Administratör

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

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

      Administratör

      • 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

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

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

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

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

  38. Rashmirekha Moharana says

    Hi Syed.

    Thanks a lot for such a wonderful solution. Let me implement and see.

    Kudos to you.

Lämna ett svar

Tack för att du väljer att lämna en kommentar. Tänk på att alla kommentarer modereras enligt våra policy för kommentarer, och din e-postadress kommer INTE att publiceras. Vänligen använd INTE nyckelord i namnfältet. Låt oss ha en personlig och meningsfull konversation.