Setting Up an Email for your domain with CPanel

Create an email account with cpanel

Setting up SMTP

In Old CPanel
Email Accounts >>

go to the particular email account >> Configure Email Client

ON Updated CPanel

Email Accounts >>

Go to the particular email account >> Manage

On the next page >> Connect Devices uder Configuration Tab
*most likely you will get smtp and pop3 settings, in the first email you get from your host when you set up the email

Using Gmail account and space for the email you created

https://www.doteasy.com/domain-email-and-website-hosting-articles/importing-your-domain-email-account-into-your-gmail-account
https://www.hostinger.in/tutorials/email/how-to-set-up-gmail-for-your-own-domain

For Outgoing Email

  1. Login to Gmail
  2. Click Settings Icon
  3. Click on Accounts and Import Tab
  4. Look for Send mail as:
  5. Look for (Use Gmail to send from your other email addresses) just below it
  6. click Add another Email Address
  7. Configure SMTP settings correctly
  8. Averification email will be sent to that email with verification code
  9. Enter the verification code

For Incoming Email

  1. Click Add amail acocunt to the right of Check mail from other accounts:
  2. Set POP3 settings

Using Gmail mailservers in your custom apps like PHPMailer

https://support.google.com/accounts/answer/185833

Create & use App Passwords

1 . Login to Gmail

  1. Go to manage accounts
  2. Go to Security tab
  3. Enable 2-Step Verification
  4. Set up App Password, a 16 digit password will be automattically generated by google . This should be set as $mail->Password while you use php mailer, not the login password
  5. Secure connection ( SSL/TLS ) is required: Tick the checkbox. this is important if you use PHPmailer, you must set $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS/STARTSMTPS, based on this setting
  6. Normally the server settings for Gmail will be like
    SMTP server($mail->Host) : smtp.gmail.com
    SMTP port($mail->port) : 587