Emails from my website aren't working

Emails from my website aren’t working

If emails from your website aren’t being sent or delivered, this is likely because InfinityFree restricts the PHP mail() function that most websites use by default. Your contact forms, registration emails, password resets, and other automated emails may not work as expected.

This is normal on free hosting and there’s a straightforward solution: use an external email service instead of the built-in mail system.

What should I do to fix email sending?

The best approach is to configure your website to send emails through an external SMTP service. This actually gives you more reliable email delivery than using server-based mail functions.

For WordPress sites

WordPress doesn’t support SMTP out of the box, but many plugins exist that can add that functionality. The FluentSMTP plugin is a completely free plugin that supports many SMTP providers. Once installed, you can configure it to use your Gmail account or another email provider.

For other website platforms

Check your website software’s settings for SMTP or email configuration options. Most modern content management systems and frameworks include built-in SMTP support. If not, search for an SMTP plugin or extension designed for your specific platform.

For custom websites

If you’re building your own site, you’ll need to replace PHP mail() calls with an SMTP library like PHPmailer. InfinityFree provides a working example contact form using PHPmailer that you can download and customize: GitHub - InfinityFreeHosting/contactform: Simple contact form with PHPMailer

Which email providers should I use?

Many people start with a free Gmail account since you may already have one, and it’s easy to add to your website for sending emails.

There are many external email providers that work well with InfinityFree. All of these options offer free tiers and are compatible with our hosting: SMTP2GO, Brevo, MailerSend, and Resend.

You’re not limited to these choices though. Any external SMTP service should work fine with InfinityFree hosting, so feel free to choose based on your specific needs and preferences.

What about premium hosting?

Premium hosting fully supports PHP mail(), so you can send emails directly from your website without needing external services. However, using a specialized email provider can still be beneficial since they typically offer higher sending limits, better deliverability, and more advanced features than server-based email.

Why doesn’t PHP mail() work on free hosting?

InfinityFree severely restricts the PHP mail() function to prevent spam and abuse. Most messages sent through PHP mail() are rejected by the mail system, which means in practice you cannot rely on PHP mail() for website emails.

This is actually common among free hosting providers, and using external email services is considered the better practice for reliable email delivery. Your emails are less likely to end up in spam folders when sent through established email providers rather than directly from hosting servers.

7 Likes
Php mail() on free plan
Php mailer cant send email
Emails are not working
Receive email alerts via a form on the site
I can't receive E-mail
Email call in php is not being sent
PHP Form in HTML
How can i make free business email on infinityfree subdomains
How to send mail from free infinity hosting
Contact Form (PHP)
Unable to send email from contact form 7 in wordpress
Mail sender
Emails from form Elementor
Phpmail
Mail()
Website does not send email
How to make contact form using php to send the email
Confusing: Two Different Usernames/Passwords
How create email like [email protected]
PHP Mailto Funtion on Contact Form Post but I don't receive email
Can send email in php
PHP Function Not Working
Getting 504 gateway timeout on sending email using phpmailer
Problem with submitting .php form to email
Contact form 7 not sending
Where can I find the SMTP settings
Recieve form message to my email
Send mail with PHPMailer
wpForo Not Sending User Confirmation Emails – How to Fix?
Forever payment loading
Problem with new script install
How can i configure email setup in free hosting
Support for php mailer
Enabling php mail services
Problem with submitting .php form to email
A minor error in HTML forms which you can solve easily
How to Resolve Namecheap server issues?
E-mails not sent from my site
Php email confirmation
UVdesk Problem
Errors upload stating to contact admin
SMTP plugin required for login forms on Wordpress websites?
Email not working
Php file keeps returning as html text
Actions in MySQL use or spend my Daily Hits Used?
Not receiving email from my contact form
Php pages
Login issues with Hubzilla script!
Vanilla Forum Email is not working
Unable to receive Email on Prokbun mail
Help needed with PHPMailer
My codeigniter site is not sending verification email
Email message will not send (PHP script verified good)
Aide
Not able to open website session issue

A post was split to a new topic: Hosting Enquiry

Is there any other free and reliable external SMTP service from a trustworthy country, aside from Google? I’ve had a bad experience with Google as it locked me out of my own account multiple times for no reason.

Plenty of providers exist that provide free SMTP capabilities, many are even better for this purpose than Gmail.

Whether they are from a “trustworthy country” depends on which countries you find trustworthy.

6 Likes

I have my own domain, and my website is hosted on InfinityFree. The domain’s nameservers are pointed to InfinityFree. However, outgoing email with PHP’s mail() function is heavily restricted on InfinityFree. I would like to set up email addresses with my domain, such as [email protected], and I also want to add a contact form to my website.

  1. To set up an email address like [email protected], how can I do it? Do I need to use an external email provider like Zoho? Zoho requires adding a new TXT record and pasting the provided TXT value into the DNS configuration. How do I do that? Is this the correct way to configure email for my domain?
  2. If I have a contact form (e.g., Contact Form 7) on my website, how does it affect email functionality? Do I need to use a specific contact form plugin that sends emails via an SMTP server? Should I change to a different plugin for this?

You need to use SMTP for sending, yes.

TXT records are not supported on free hosting, verification needs to be done with CNAME records.

4 Likes

Thanks. I did it. I need to wait for this change to propagate. I hope it will work.

hi, if i use plugins like wp form, met form, etc i don’t receive any notification on my gmail as administrator, is it correct? how can i solve it?I use a free subdomain

Did you even read this article? It demostrates exactly that if you didn’t go through it it’s normal that you don’t recieve any emails, and only if you go through it can you recieve any email.

5 Likes

Are you using the same Gmail account to send and receive the email? If so, Gmail may be skipping the inbox and only storing the message in the Sent folder of your account. That’s a feature from Gmail, it’s not a problem with your code, and it definitely has nothing to do with our hosting. The solution is to not use the same email account to send and receive the email.

Alternatively, the email might not be sent correctly at all. The list of possible reasons for that is very, very long, and is not suitable for a comment to a general article. So if you’re having problems sending email with your website and the software you’re using to do so, please create a new topic in Hosting Support and describe the issue there.

5 Likes