上QQ阅读APP看书,第一时间看更新
Getting ready
For this recipe, we require a valid email account set up, which includes the following:
- A valid email server
- A port to connect to
- An address
- A password
These four elements should be enough to be able to send an email.
Some email services, for example, Gmail, will encourage you to set up 2FA, meaning that a password is not enough to send an email. Typically, they'll allow you to create an specific password for apps to use, bypassing the 2FA request. Check your email provider's information for options.
The email provider to use should indicate what the SMTP server is and port to use in their documentation. They can be retrieved from email clients as well, as they are the same parameters. Check your provider documentation. In the following example, we will use a Gmail account.