Adding a mailbox to a phone takes a minute once you have the four settings. The one decision that matters is IMAP or POP3, and it is made before you type anything.
Choose IMAP
IMAP keeps the mail on the server, so the phone, the laptop and webmail all see the same mailbox. POP3 downloads and often deletes, which means mail read on the phone is gone from everywhere else - see IMAP versus POP3.
The settings
Incoming (IMAP)
server mail.yourdomain.com
port 993
security SSL/TLS
username you@yourdomain.com <- the FULL address
Outgoing (SMTP)
server mail.yourdomain.com
port 465 (SSL) or 587 (STARTTLS)
security SSL/TLS or STARTTLS
auth yes - same username and password
The username is the whole email address, not the part before the @. Entering just the name is the most common reason a correct password is rejected.
Choose Manual, not automatic
Phone setup wizards guess the server names and usually guess wrong for a custom domain. On iOS choose Other, then Add Mail Account, then IMAP. On Android choose Personal (IMAP) and Manual setup.
If it will not connect
- Certificate warning - you are connecting to a hostname the certificate does not cover. Use the exact server name your host gave you, not your own domain.
- Incoming works, sending fails - authentication is not enabled on outgoing, or the mobile network blocks port 25. Use 465 or 587, never 25.
- Password rejected - the full address as username, and check whether the account requires an app-specific password.
Turn on Push or a 15-minute fetch rather than checking constantly. A mail app polling every minute is one of the largest battery costs on a phone and finds nothing 95% of the time.