I have a question regarding php mail(). I know its not supported in the free version, but I want to upgrade and make it so tht this is possible. The only thing I am wondering is if I still need to fix smtp functions? I want to send mails using an gmail account, but is there any other mails I can use that are easier? This is regarding a exam I have at school.
The emails are based on a booking page for customer where they will get date og what kind of apointment they have chosen.
On premium hosting, you can choose to send email with PHP mail() (in which case the mails will be sent by the hosting server), or with SMTP, in which case you can use any SMTP server or service you want.
Gmail provides free SMTP, but there are numerous other providers to choose from, including those that will let you send email with your own domain name.
Free hosting doesn’t support PHP mail(), but does support using external SMTP services. So I’m not sure what you need to “fix” regarding this.
If you use premium hosting, emails will be sent from premium hosting servers.
You simply can’t send gmail from somewhere else without smtp. Either you can’t figure it out or they’ll get blocked by gmail’s SPF, DKIM, and DMARC records.
If you don’t configure any SMTP service yourself and send email with PHP mail(), email is sent by the hosting provider. This could mean the hosting provider delivers email directly from the hosting server, or they relay it through another SMTP server, which could be their own server or the ones from a provider that specializes in email.
A hosting provider could use Gmail for that too, yes, but that would be a very bad decision, because Gmail really doesn’t work well for that. It’s passable for a single website, not for a server with hundreds of websites.
And remember that email is an open protocol. Any email host can send email to any other email host.