Configuring the Email Sending Module¶
This document explains the steps to configure WSO2 Identity Server to send emails during multiple email related identity and access management tasks such as email OTP, email notifications, account recovery.
- Shut down the server if it is running.
-
Add the following properties to the
deployment.tomlfile in the<IS_HOME>/repository/conffolder to configure the email server.[output_adapter.email] from_address= "[email protected]" username= "wso2iamtest" password= "Wso2@iam70" hostname= "smtp.gmail.com" port= 587 enable_start_tls= true enable_authentication= true signature = "ABC.com"from_addressThe mail address from where you want to send the notification. It can be any working mail address. usernameProvide the username of the SMTP account.
Username of the mail you have provided in from_addresspasswordProvide the password of the SMTP account.
Password of the mail you have provided in from_addresshostThe SMTP server to connect to. portThe SMTP server port to connect to, if the connect() method does not explicitly specify one. Defaults to 25. enable_start_tlsIf true, enables the use of the STARTTLS` command (if supported by the before issuing any login commands. Note that an appropriate trust store must configured so that the client will trust the server's certificate. Defaults to true. enable_authenticationIf true, attempt to authenticate the user using the AUTH command. Defaults to true. signatureSpecifies the display name for the "From" email address. For example, "ABC Company" results in "ABC Company" <[email protected]>).
If you don't set this property, the display name becomesnulland the system falls back to your SMTP server settings. For example, some servers use theusernameas the display name.
To send an email with no display name and show only the email address, set this value to an empty string:signature = "".Tip
For information about the SMTP, see here.
-
Re-start the server once configurations are in place.
Note
If you are using a Google mail account, note that Google has restricted third-party apps and less secure apps from sending emails by default. Therefore, you need to configure your account to work around this restriction, as WSO2 Identity Server acts as a third-party application when sending emails to confirm user registrations or notification for password reset WSO2 Identity Server.
Follow the steps provided by Google to create an app specific password and use it for the SMTP configurations on the WSO2 Identity Server so that Google does not restrict the access.