Free and Unlimited Web Hosting

Sending email from your website (PHP mail)

Sending email from your website (PHP mail)

The most common way to send email from your website is by using the PHP mail() function. PHP mail() is an easy to use email system built into the PHP programming language. It's the default setting for almost all applications.

However, PHP mail is severely restricted on InfinityFree. To prevent spam and other abuse, most messages sent through PHP mail are rejected by the mail system. In practice, this means you cannot use PHP mail on InfinityFree to send your email.

If you want to send email from your website, the easiest option is to use an external SMTP service. Most applications offer a setting or plugin to send email with SMTP. We have written an article about how to send email with Gmail SMTP, which includes instructions on how to configure SMTP in your Gmail account and code samples to help you integrate SMTP in your own software.

Alternatively, you could consider to upgrade your account to premium hosting. With a premium hosting account, there are no filters on PHP mail() and the sending limits are much higher than on free hosting. So on premium hosting, you'll be able to send professional looking email with ease.

Still have questions? Check our forum!