microsoft / azure-devops-engineering-extensions

AzureDevOps marketplace extension that contains various engineering oriented Pipeline tasks
MIT License
19 stars 19 forks source link

MailError while sending Email : "Invalid login: 535 5.7.3 Authentication unsuccessful" #40

Open PrasadSusant opened 4 years ago

PrasadSusant commented 4 years ago

Hi Team,

Although I am using correct credential for sending email but still I am getting below error while running this task in Azure DevOps release pipeline. Can you please look into it and let me know if I am missing anything or Is there any other requirement for sending email?

Using Generic connection to set up Setup SMTP Endpoint Server URL : https://outlook.office365.com/EWS/Exchange.asmx ( NOTE : This is not public SMTP server) Agent Pool : Azure Pipeline. Error Message :

_2020-05-01T19:13:50.9606439Z Host: outlook.office365.com 2020-05-01T19:13:50.9606806Z HostName: outlook.office365.com 2020-05-01T19:13:50.9607122Z Port: null 2020-05-01T19:13:50.9607425Z Protocol: smtp: 2020-05-01T19:13:50.9608226Z Using HostName: outlook.office365.com and port: 587 2020-05-01T19:13:56.0715522Z MailError: Error: Invalid login: 535 5.7.3 Authentication unsuccessful [XXXXXX.namprd13.prod.outlook.com] 2020-05-01T19:13:56.0717044Z MailError: Error: Invalid login: 535 5.7.3 Authentication unsuccessful [XXXXXX.namprd13.prod.outlook.com] 2020-05-01T19:13:56.0717722Z MailError: Error: Invalid login: 535 5.7.3 Authentication unsuccessful [XXXXXX.namprd13.prod.outlook.com] 2020-05-01T19:13:56.0719012Z at ReportError (D:\a_tasks\EmailReport_36fd41b1-8024-4ce9-a5a0-53c3e54ed105\1.1.8\exceptions\ReportError.js:6:9) 2020-05-01T19:13:56.0719704Z MailError: Error: Invalid login: 535 5.7.3 Authentication unsuccessful [XXXXXX.namprd13.prod.outlook.com] 2020-05-01T19:13:56.0720908Z at MailError (D:\a_tasks\EmailReport_36fd41b1-8024-4ce9-a5a0-53c3e54ed105\1.1.8\exceptions\MailError.js:6:9) 2020-05-01T19:13:56.0721649Z at ReportError (D:\a_tasks\EmailReport_36fd41b1-8024-4ce9-a5a0-53c3e54ed105\1.1.8\exceptions\ReportError.js:6:9) 2020-05-01T19:13:56.0722902Z at EmailSender. (D:\a_tasks\EmailReport_36fd41b1-8024-4ce9-a5a0-53c3e54ed105\1.1.8\EmailSender.js:66:23) 2020-05-01T19:13:56.0723656Z at MailError (D:\a_tasks\EmailReport_36fd41b1-8024-4ce9-a5a0-53c3e54ed105\1.1.8\exceptions\MailError.js:6:9) 2020-05-01T19:13:56.0724639Z at throw (native) 2020-05-01T19:13:56.0725158Z at EmailSender. (D:\a_tasks\EmailReport_36fd41b1-8024-4ce9-a5a0-53c3e54ed105\1.1.8\EmailSender.js:66:23) 2020-05-01T19:13:56.0728008Z at rejected (D:\a_tasks\EmailReport_36fd41b1-8024-4ce9-a5a0-53c3e54ed105\1.1.8\EmailSender.js:5:65) 2020-05-01T19:13:56.0728497Z at throw (native) 2020-05-01T19:13:56.0729381Z at process._tickCallback (internal/process/next_tick.js:109:7) 2020-05-01T19:13:56.0729961Z at rejected (D:\a_tasks\EmailReport_36fd41b1-8024-4ce9-a5a0-53c3e54ed105\1.1.8\EmailSender.js:5:65) 2020-05-01T19:13:56.0731413Z (node:3792) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): MailError: Error: Invalid login: 535 5.7.3 Authentication unsuccessful [XXXXXX.namprd13.prod.outlook.com] 2020-05-01T19:13:56.0732182Z at process._tickCallback (internal/process/nexttick.js:109:7) 2020-05-01T19:13:56.0733006Z Task Processing Complete.

PrasadSusant commented 4 years ago

Hi , Is it possible to run this email Task feature using Office365 SMTP server or is it meant only for Public SMTP server ? Can anyone please clarify?

saikrishnav commented 4 years ago

@PrasadSusant As long as the agent can connect to the email servers, this should work. we have tested this with private servers and shouldn't be any different.

https://stackoverflow.com/questions/36355271/how-to-send-email-with-powershell You can add a INLINE powershell task to your pipeline with above script. Change the params to yours and see if it works. If this powershell script works in your agent, email task should work.

Clealry in your case, authentication is failing - not a connection issue.

saikrishnav commented 4 years ago

can you try unchecking "Enable TLS" checkbox in the task options and see what happens?