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
2. Edit Contact Form Settings
3. Edit Email SMTP Settings
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.
5. Publish Contact Form
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.
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,
viraloke says
Thank you man… following the guidance from you and succes sending email from my contact form
Leron Amin says
Glad to hear the tutorial was helpful to you!
Hector says
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.
Ti. says
Thanks so much. Your tutorial has helped me setup the emailing on a site. Thanks a lot. I wish you a good day.
Leron Amin says
Thanks for the feedback Ti – I’m glad to hear the tutorial helped you!
Patel says
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.
Leron Amin says
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
Also unable to send mail in gmail.
Avinash says
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.
Leron Amin says
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
Thanks that very helful link. I will try it
Shahbaaz says
Thank you so much. The linked article helped me a lot. And all your tutorial videos are great.
Love your work!
Leron Amin says
Thanks shahbaaz – I’m glad to hear the article helped you!
Kaibron says
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 …
Leron Amin says
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
Thank you Leron.
Ante Kordic says
Hi, any chance to connect the [email protected] from zoho with the smtp trough gcp?
Many thanks for all of your tutorials!!
Leron Amin says
Hi Ante,
Unfortunately this is no longer possible under the Zoho free plan.
Hope this information helps,
Joe
Ante Kordic says
Ok Thanks Joe!!
Leron Amin says
No problem! 😀
G J P says
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.
Leron Amin says
Hi GJP,
I agree with you that unblocking these commonly used ports would improve GCP.
Thanks for sharing,
Joe
Victor says
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?
Leron Amin says
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
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
Hi Victor,
Thanks for the update!
I’m glad to hear that everything is working well. 😀
ansri says
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.
Leron Amin says
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
It worked thanks! Had added a plugin from a different author.
Leron Amin says
Good to hear! I’m glad you got it working!
Muhammad Royyan says
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
Leron Amin says
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
Rob McDonald says
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
Leron Amin says
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
David says
Does not work. Recommended troubleshooting does not work either.
Leron Amin says
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
Borislav says
Arrghhh, great tutorial!!
Thank you so much Joe
It saved my life 🙂
Leron Amin says
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
Abu says
i am using google cloud compute engine and bitnami wordpress …why is it contact form 7 not working still?
Leron Amin says
Hi Abu,
What is the error message that you are seeing?
abu tahir says
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
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
i did that also.
Leron Amin says
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
ric says
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.
Leron Amin says
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
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
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
Leron Amin says
What did you think of this tutorial?
Please share your questions and comments below!
Thanks,
Joe
Abbas Mehran says
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
Hi Abbas,
I am glad to hear that you got the problem resolved! 🙂
Best regards,
Joe