spring-framework / org.springframework.mail.javamail / JavaMailSenderImpl / setPassword

setPassword

open fun setPassword(@Nullable password: String): Unit

Set the password for the account at the mail host, if any.

Note that the underlying JavaMail Session has to be configured with the property "mail.smtp.auth" set to true, else the specified password will not be sent to the mail server by the JavaMail runtime. If you are not explicitly passing in a Session to use, simply specify this setting via #setJavaMailProperties.

See Also
#setSession#setUsername