To use WordPress to send an email, you need to install the SMTP plugin from your WordPress site first. For example, install Easy WP SMTP
Please follow the steps below to install it
1. log in to your WordPress site > Plugins > Add New
2. Search for Easy WP SMTP
and install it
3. Active it
Now you can use it to set SMTP authentication.
1. Go to Settings
2. Click "Easy WP SMTP"
Note: username should be the same as From Email