How to send email with Gmail SMTP

Outgoing email with PHP mail() is heavily restricted on InfinityFree. Fortunately, you can still whatever email you want using an external email service.

There are many external email providers to choose from. InfinityFree doesn’t restrict sending email with external providers. Almost all of them have paid plans, but some have free tiers too. Most of them support sending email over SMTP, some of them have custom APIs, libraries and plugins which you can use too.

A simple way to get started quickly and for free is to send email with a free Gmail account.

If you use existing website management software, this software may have support for SMTP built-in. If not, there is usually a plugin you can use to send email with SMTP, or even connect it directly with your desired e-mail provider.

If you’re using WordPress, you can use the WP Mail SMTP by WPForms plugin. This plugin allows you to send email with any SMTP server, and even natively support Gmail as a preferred provider.

If you’re building your own website, you’ll need to code something yourself. SMTP libraries like PHPmailer or SwiftMailer make this easy. To help you get started, we have provided an example contact form with PHPmailer which you can use for your own website: https://github.com/InfinityFreeHosting/contactform

3 Likes
Php mail() on free plan
WP email plugins: Gmail SMTP vs WP Mail SMTP
PHPMailer not working
Smtp connect() failed
How to send mail from free infinity hosting
Question About Mail accounts
Want to edit php.ini to update Gmail SMTP but why i can't?
Use of smtp server
Phpmail
Unable to send email from contact form 7 in wordpress
Email not working
Smtp is not sending mail to gmail users
How to get email verification working in elgg, or other social media?
How do i enable "IMAP PHP Extension"?
Where can I find the SMTP settings
My florum Forum cant send sign up confirmation emails
PHP Form in HTML
Problem with submitting .php form to email
Problem with submitting .php form to email
Website not working
Send mail with PHPMailer
wpForo Not Sending User Confirmation Emails – How to Fix?
Error 500 connection refused
Smtp
Smtp
How can i configure email setup in free hosting
Contact form 7 not sending
Enabling php mail services
Can i use PHPMailer In my free plan?
Support for php mailer
How can i add email send event on form submit (from user email to admin email)
UVdesk Problem
SMTP plugin required for login forms on Wordpress websites?
How can i login to Roundcube webmail
A minor error in HTML forms which you can solve easily
Verification in php
How can I compress(using zip) a file when it exceeds certain limit on server?
How to send email
A question that sounds like impossible
Why is the email not going from my site?
Website does not send email
Why is the email not going from my site?
Connecting Email To MyBB Forum?
Is there a replacement for the mailto function?
Aide
Aide
Not able to open website session issue

Is it supposed to be

you can still use whatever email you want using an external email service.

?

3 Likes

I just checked this article and the companion article about PHP mail. I rewrote the other one to be more clear and complete, and I think this article mainly provides the same information (unlike what the other article promises it would be).

So this one is now archived.