One Page Zen

Web Design. Simplified.

  • Tutorials
    • Google Cloud
    • Amazon Cloud
    • Microsoft Cloud
  • Start
  • Resources

Setup Contact Forms for WordPress on Google Cloud

November 12, 2020 Leron Amin 51 Comments

FacebookTweetLinkedInEmail

Are you frustrated trying to get your WordPress website’s contact forms to work on Google Cloud Platform? You’re not alone.

In this tutorial you will learn how to properly setup WordPress contact forms on Google Cloud Platform.

Before starting this tutorial, you should have already launched WordPress on Google Cloud Platform. You should also create a separate Google/Gmail account to handle all of your contact form emails.

There are 6 steps in this tutorial:

  • 1. Download Plugins
  • 3. Edit Email SMTP Settings
  • 4. Allow Less Secure Apps
  • 2. Edit Contact Form Settings
  • 5. Publish Contact Form
  • 6. Troubleshoot

1. Download Plugins

Setup Contact Forms in WordPress on Google Cloud
The first step is to install and activate the WP-Mail-SMTP plugin. This plugin will be used to re-configure your mail settings.
Setup Contact Forms in WordPress on Google Cloud
The other plugin you will need to install and activate is Contact Form 7. This plugin will be used to create contact forms.

2. Edit Contact Form Settings

Setup Contact Forms in WordPress on Google Cloud
After installing and activating the Contact Form 7 plugin, you will notice a Contact icon appear on the left-hand side of your WordPress dashboard. Click this icon, then click on Contact form 1.
Setup Contact Forms in WordPress on Google Cloud
Now that you’ve opened Contact Form 1, navigate to the Mail tab, and change the To field to the Gmail address where you want the contact form submissions to be sent.

3. Edit Email SMTP Settings

Setup Contact Forms in WordPress on Google Cloud
Next, navigate to Settings > Email. At the top of the page under the Advanced Email Options section, change the From Email field to match the same Gmail address that you used in the last step. Change the From Name field to whatever you want. Change all of the other settings in this section to match the settings in the picture. After making these changes, click the Save button.
Setup Contact Forms in WordPress on Google Cloud
Next, scroll down the page to the SMTP Options sections. Enter the email address and password for the Gmail account that you entered in the previous steps. Change all of the other settings in this section to match the settings in the picture. After making these changes, click the Save button.

4. Allow Less Secure Apps

As a security precaution, Google blocks account activity from apps that don’t use up-to-date security standards. For this reason, you will need to bypass this feature and tell Google to allow Less secure apps to access your Google/Gmail account.

Setup Contact Forms in WordPress on Google Cloud
To fix this issue, sign in to the Google/Gmail account that you have designated to handle your WordPress contact form emails, then navigate to the Less Secure Apps settings page and click the slider button to allow Less Secure Apps.

5. Publish Contact Form

Setup Contact Forms in WordPress on Google Cloud
Next, go back to the Contact section of you WordPress dashboard. Copy your contact form shortcode.
Setup Contact Forms in WordPress on Google Cloud
Paste the shortcode in a new WordPress post, then visit the post page to test out your contact form.
Setup Contact Forms in WordPress on Google Cloud
Next, send a test contact form to see if it’s working. If it works, great! If not, proceed to the step below.

6. Troubleshoot

If you try to send an email and get an error message, Google may have blocked the SMTP plugin from sending mail from your account.

Setup Contact Forms in WordPress on Google Cloud
To fix SMTP security issues, login to the Google account that you used in setting up this tutorial. Next, head over to Google device activity and choose YES THAT WAS ME to authorize the SMTP application to send email.

Did it Work?

If your contact form is working properly, you will notice a green success message appear after clicking the send button.

If you have any questions or comments, please post them below!

Thanks,

Up Next…

google cloud ftp setup filezilla
Manage WordPress Files on Google Cloud Platform (Beginner)
manage wordpress files on google cloud
Manage WordPress Files on Google Cloud Platform (Advanced)

Related Posts

  • How to Fix FTP Permission Errors on Google Cloud
  • The Most Important Linux Commands (With Examples)
  • Increase File Upload Size WordPress on Google Cloud
  • How to Fix SSH (Linux Shell) Permission Errors on Google Cloud
  • Get Started with WordPress on Google Cloud Platform
  • Setup CloudFlare CDN for WordPress on Google Cloud
FacebookTweetLinkedInEmail

Filed Under: GCP WordPress, Google Cloud Platform Tagged With: contact form, contact form 7, gmail, google cloud, smtp, wordpress, wp mail smtp

Comments

  1. viraloke says

    September 9, 2020 at 6:34 am

    Thank you man… following the guidance from you and succes sending email from my contact form

    Reply
    • Leron Amin says

      September 14, 2020 at 10:39 pm

      Glad to hear the tutorial was helpful to you!

  2. Hector says

    March 24, 2020 at 3:46 pm

    Yo ya había probado esto pero no me funcionó con varios intentos ni distintas webs.
    Al parecer no queda de otra que usar el método de API AUTH es mucho más complicado y NO ES UNA SOLUCIÓN DEFINITIVA ya que la API tiene que estar creada en la misma cuenta de gmail con la que se está usando GCP y eso no funciona si se quiere usar para páginas de clientes o páginas que van a llevar otro correo distinto al de GCP.

    UN SIMPLE CORREO LO HAN HECHO UNA CHINGA DE HORAS Y HASTA DE DÍAS.
    Ahí está muy mal GOOGLE.

    Reply
  3. Ti. says

    January 8, 2020 at 11:01 pm

    Thanks so much. Your tutorial has helped me setup the emailing on a site. Thanks a lot. I wish you a good day.

    Reply
    • Leron Amin says

      January 18, 2020 at 8:34 pm

      Thanks for the feedback Ti – I’m glad to hear the tutorial helped you!

  4. Patel says

    June 3, 2019 at 5:48 am

    My contact form unable to send mail to my zoho mail address.
    I use apache in google cloud platform.
    What i do about this problem in Apache on gcp.

    Reply
    • Leron Amin says

      June 8, 2019 at 3:48 pm

      Hi Patel,

      Configure the contact form with Gmail – then from within Gmail, change your settings in order to automatically forward the contact from submissions from Gmail to Zoho.

      Hope this helps and let me know if you have questions,
      Joe

    • Patel says

      June 19, 2019 at 8:08 pm

      Also unable to send mail in gmail.

  5. Avinash says

    December 10, 2018 at 12:42 pm

    Hello

    Thaks to you GCP WordPress Tutorial I got my website up and running. But stuck now currently i can’t reset my password from “wp-admin” it says “The email could not be sent.
    Possible reason: your host may have disabled the mail() function.”

    and also in wordpress settings general, there is email address field where i can’t see to change it.
    it shows “[email protected]” this but when i put my own email id from which i created wordpress i didn’t receive any mail for confirmation. It says “There is a pending change of the admin email to [email protected].”

    Please Help i’m using WordPress Bitnami.

    Thanks Again for you wonderful tutorial.

    Reply
    • Leron Amin says

      December 14, 2018 at 6:25 pm

      Hi Avinash,

      Default mail ports are blocked in Google Cloud, so you’ll have to configure SMTP to send emails from your instance.

      Use the WP Forms STMP plugin along with this tutorial for instructions on how to securely send emails from your instance (including for password resets, as in your case).

      Please reach out if you have questions,
      Joe

    • Avinash says

      December 14, 2018 at 11:43 pm

      Thanks that very helful link. I will try it

    • Shahbaaz says

      October 14, 2019 at 5:03 am

      Thank you so much. The linked article helped me a lot. And all your tutorial videos are great.
      Love your work!

    • Leron Amin says

      October 19, 2019 at 12:53 pm

      Thanks shahbaaz – I’m glad to hear the article helped you!

  6. Kaibron says

    July 31, 2018 at 1:06 pm

    Hi Leron,
    I would like to do email marketing and e-com and I registered on mailchimp, does this tutorial work with or could you tell me which is the tutorial that is close to what I’m looking for?
    Of all the tutorials I’ve looked for, it’s the only one I have not found or I do not have to know what’s the good …

    Reply
    • Leron Amin says

      August 1, 2018 at 2:21 pm

      Hi Karibron,

      I use MailChimp as well, but this tutorial is simply an instructional on how to configure Contact Form 7 and WP Mail SMTP.

      I would do a Google search for additional tutorials. Also check out the MailChimp for WP plugin – this plugin integrates nicely with Contact Form 7.

      Good luck and I hope this helps,
      Joe

    • Kaibron says

      August 4, 2018 at 3:08 am

      Thank you Leron.

  7. Ante Kordic says

    April 22, 2018 at 3:01 pm

    Hi, any chance to connect the [email protected] from zoho with the smtp trough gcp?

    Many thanks for all of your tutorials!!

    Reply
    • Leron Amin says

      April 22, 2018 at 7:57 pm

      Hi Ante,
      Unfortunately this is no longer possible under the Zoho free plan.
      Hope this information helps,
      Joe

    • Ante Kordic says

      April 23, 2018 at 7:07 am

      Ok Thanks Joe!!

    • Leron Amin says

      April 23, 2018 at 10:17 am

      No problem! 😀

  8. G J P says

    March 4, 2018 at 1:47 am

    Google Compute Engine has all standard outgoing SMTP ports blocked by design. Please vote here to get Google’s SMTP behavior changed:
    https://googlecloudplatform.uservoice.com/forums/302595-compute-engine/suggestions/10079937-send-and-receive-email-using-tcp-smtp-imap-ports

    Until they open the SMTP ports, there will be no good way to send email from their cloud servers. Sendgrid and the others are too expensive and lack many features that are needed.

    Reply
    • Leron Amin says

      March 4, 2018 at 11:37 am

      Hi GJP,

      I agree with you that unblocking these commonly used ports would improve GCP.

      Thanks for sharing,
      Joe

  9. Victor says

    February 2, 2018 at 11:53 am

    Hi Joe! The tutorial worked really good but I would like to know how can I change the following:

    When I receive an email in the gmail account, int the inbox the email say from me.

    In the forms I have I ask for the name of the person and in my previous hosting I could have the forms be sent by the persons name. Now, all the emails I receive say me, me, me, me

    I tried a couple things but couldn’t make it work. Any ideas?

    Reply
    • Leron Amin says

      February 5, 2018 at 1:27 am

      Hi Victor,

      Were you able to get the issue resolved?

      If you’re using contact form 7, try deleting then recreating the form from a fresh template and see what happens.

    • Victor Garcia says

      February 6, 2018 at 12:46 pm

      Hi Joe!

      YES, my problem was that the sender email and receiver email were the same, and that was causing that the name shown was always me.

      Changed the sender email to wordpress@mydomain. com and worked like a charm

      Thanks again for the tutorial

    • Leron Amin says

      February 6, 2018 at 1:50 pm

      Hi Victor,

      Thanks for the update!

      I’m glad to hear that everything is working well. 😀

  10. ansri says

    February 1, 2018 at 8:55 am

    I could not follow from Step 3, I guess the plugin must have been updated since you posted this tutorials, as all the options have changed. Can you verify.

    Reply
    • Leron Amin says

      February 1, 2018 at 2:53 pm

      Hi Ansri,

      Did you verify that you are using the correct SMTP plugin? There are many of them to choose from.

      Please confirm that you’re using the right one and I will look into the issue! 🙂

      Thanks,
      Joe

    • ansri says

      February 1, 2018 at 9:14 pm

      It worked thanks! Had added a plugin from a different author.

    • Leron Amin says

      February 1, 2018 at 9:18 pm

      Good to hear! I’m glad you got it working!

  11. Muhammad Royyan says

    December 25, 2017 at 6:34 pm

    Hello, thank you for your tutorial. I wanna ask you something, is it work if I use custom email from Zoho Mail? I mean i will not use gmail as destination mail address. Sorry for my bad english

    Reply
    • Leron Amin says

      December 26, 2017 at 11:48 am

      Hi Muhammad,
      Yes you may, however, your SMTP host and port information may be different – so you will have to make the appropriate modifications.
      Regards,
      Joe

  12. Rob McDonald says

    October 13, 2017 at 8:08 am

    Joe,

    Let me first say that I am relatively new to cloud computing, and if not for your web site, I would not have started with Google Cloud. Your tutorials helped me greatly in learning to set up sites on Google Cloud. This also open me up to other possibilities with the Google Cloud Platform.

    Recently I have had some issues with contact forms and them not sending emails. I use Ninja forms and WP Forms.

    I did a lot of research on this and found my best solution to use a smtp plugin called “Gmail SMTP.” This plugin is a little harder to setup then the one you mention in your article, but I feel that it is better. I tried using the one you mentioned, and others, and could just not get them to work correctly.

    The plugin I mentioned does require you to use your gmail account, go into the Google Cloud console and set up the Gmail API and get OAuth 2.0 credentials.

    It seems that Google maybe trying to get away from people using the “less secure apps” option when setting up SMTP mail, as I was getting errors with my account when trying to use these options.

    The Gmail SMTP plugin works great once you get it setup and there is a great tutorial that shows you how to set it up. I will put the link below this comment so you can decide if you want this link to go through or not. Just though it might be helpful to you and your readers.

    –Rob

    https://wphowto.net/gmail-smtp-plugin-for-wordpress-1341

    Reply
    • Leron Amin says

      October 13, 2017 at 1:22 pm

      Hi Rob,

      I am glad very glad to hear the tutorials on the site have helped you 🙂

      Thanks for taking the time to comment about your experience with configuring contact forms. As you are aware, contact forms don’t work ‘out-of-the-box’ on Google Cloud and for that reason can cause a lot of frustration for GCP users.

      I looked at the tutorial and using the Gmail API is probably a better practice for site security, all things considered.

      Thanks for taking the time to post the link – I am certain that many users will benefit from it! 😀

      Best regards,
      Joe

  13. David says

    October 11, 2017 at 6:56 pm

    Does not work. Recommended troubleshooting does not work either.

    Reply
    • Leron Amin says

      October 12, 2017 at 12:35 am

      Hi David,

      I am sorry the tutorial didn’t work for you!

      If you get your contact forms working, please let me know what the problem was.

      In the meantime, if you’d like help getting your contact forms working, let me know and I’d be happy to troubleshoot with you.

      Talk to you soon, 🙂
      Joe

  14. Borislav says

    September 27, 2017 at 4:41 am

    Arrghhh, great tutorial!!

    Thank you so much Joe

    It saved my life 🙂

    Reply
    • Leron Amin says

      September 28, 2017 at 10:05 pm

      Hey Boris,
      Thanks for taking the time to post a comment!
      I am very happy to hear that the tutorial worked for you. 😀
      Best regards,
      Joe

  15. Abu says

    September 23, 2017 at 4:42 am

    i am using google cloud compute engine and bitnami wordpress …why is it contact form 7 not working still?

    Reply
    • Leron Amin says

      September 23, 2017 at 2:54 pm

      Hi Abu,
      What is the error message that you are seeing?

    • abu tahir says

      September 23, 2017 at 8:53 pm

      i get this error with red border “There was an error trying to send your message. Please try again later.”
      my username and password is also correct

    • Leron Amin says

      September 23, 2017 at 10:18 pm

      Hi Abu,
      Did you complete Step 6: Troubleshoot?
      There is a chance that Google is preventing the SMTP plugin from accessing your Gmail account – the solution on how to fix this is addressed in step 6.
      Talk to you soon, 🙂
      Joe

    • abu tahir says

      September 23, 2017 at 10:21 pm

      i did that also.

    • Leron Amin says

      September 24, 2017 at 11:00 am

      Hi Abu,

      You may have to try the tutorial again. Remember, you have to replace [email protected] with your OWN Gmail address. Also, you must use a Gmail address in order for this tutorial to work properly.

      Hope this helps 🙂
      Joe

  16. ric says

    September 11, 2017 at 12:51 am

    Does this only work with gmail addresses? For my WP forms, I am trying to use a domain email address that i setup using your zoho tutorial.

    Reply
    • Leron Amin says

      September 11, 2017 at 11:11 am

      Hey Ric,
      You should use a Gmail address to set up the SMTP, but you can configure the custom email that you setup in the “Zoho” tutorial to work in Gmail. That way you can reply to the contact forms using your “Zoho” custom email address. Check out this tutorial here: http://fitsmallbusiness.com/topic/how-to-link-zoho-email-with-gmail/

    • ric says

      October 28, 2017 at 8:47 pm

      Hi,
      so everything works fine. However, in contact form 7 the “reply to field” is the domain email address, but the “from field” address is the same gmail address i used to setup the smtp plugin. Can I change the from field to the domain email address as well or do I have to have the gmail address on the from field for the contact form to work properly.

    • Leron Amin says

      October 30, 2017 at 6:46 am

      Hi Ric,
      Many people have had issues getting this tutorial to work so I am happy to hear that you got things working!
      The ‘From’ email address has to be the Gmail address that you configured with the SMTP plugin. However, after the email address is forwarded to that Gmail account, you can reply to the mail using your domain email which was the purpose of this tutorial. When it’s configured this way, all of the interactions that you have with customers through your website can be done through your custom domain name email.
      Let me know if this answers your question 🙂
      Talk to you soon,
      Joe

  17. Leron Amin says

    August 25, 2017 at 4:07 pm

    What did you think of this tutorial?
    Please share your questions and comments below!
    Thanks,
    Joe

    Reply
    • Abbas Mehran says

      September 1, 2017 at 7:21 pm

      Hi Joe,
      Thank you for your quick reply, This is now resolved, My mistakes on username and emails. However, I decided to use Gsuite, since I had it but not used it.
      Thanks,
      Abbas

    • Leron Amin says

      September 1, 2017 at 8:37 pm

      Hi Abbas,
      I am glad to hear that you got the problem resolved! 🙂
      Best regards,
      Joe

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Want Exclusive Tutorials?

Welcome to One Page Zen!

Through this blog I hope to introduce web developers to cloud computing!

author-bio

facebook-support-group kinsta-cloud-hosting

Want Exclusive Tutorials?


Contact | Sitemap | Legal | Privacy Policy | Affiliate Disclosure
      Copyright © 2017 - 2019 One Page Zen
Share this Article

Email sent!