This site has a very good explanation with the error.
How to Send email from Office 365 in your application
Cause:
The Mail Address set as the SMTP server does not have the permission to send email on behalf of other mail addresses.
Resolution:
- Make sure that the
- Do not send test email with any other mail address except for the SMTP server mail address in the
Fromfield
Your set up of email properties should be like this
mail.smtp.host=smtp.office365.com
mail.smtp.port=587
mail.smtp.starttls.enable=true
mail.smtp.auth=true
mail.smtp.ssl.trust=smtp.office365.com
mail.user=noreply@mycompany.com //your From address should be the same of the username set here
mail.password=Password123$
Am getting the same error after applying all these changes in jenkins.
ReplyDelete