You can use your own server simply by using the API of your languages ββfor sendmail , or you can use one of the various hosted mail services designed for web applications ( SendGrid , Postmark , etc.).
As for the disadvantages of using gmail, all your emails will be "sent through gmail.com" in their headers, which does not give much confidence that this is actually from your site. If you set up your own mail server, you can use SPF and DKIM to prove that the message is valid from your site. Most hosted services also (I believe) admit this. Thus, your email address is less likely to be marked as spam or may not be trusted by the user or the mail server.
As others have noted, gmail can also appreciate the restriction on sending emails, which is a huge drawback when your emails do not reach your users quickly or may not work at all.
source share