Skip to content

Azure DevOps Pipeline SMTP email not working #66

Description

@bharathiraja1986

Hi Team,

We are using Azure DevOps pipeline for our mobile app. Part of the flow, we are trying to send notification email through your email plugin which we installed from Azure market Place. Currently, we are having difficult in connecting to our Smtp server (Microsoft ).

Below is the error we receive from the pipeline logs,

2025-03-06T18:18:47.1856630Z SMTP Server: smtp.office365.com
2025-03-06T18:18:47.1859579Z SMTP Username: someabc@bjs.com
2025-03-06T18:18:47.1861711Z SMTP Port: 587
2025-03-06T18:18:47.1864732Z Use SSL?: false
2025-03-06T18:18:47.1867754Z Add Attachment?: false
2025-03-06T18:18:47.1870715Z Attachment:
2025-03-06T18:18:52.5281182Z ##[debug]Caught exception from task script.
2025-03-06T18:18:52.5321403Z ##[debug]Error record:
2025-03-06T18:18:52.5903536Z ##[debug]Send-MailMessage : Error in processing. The server response was: 5.7.3 STARTTLS is required to send mail [MN2PR01CA0045.prod.exchangelabs.com 2025-03-06T18:18:52.246Z 08DD5C8CA9C50352]
2025-03-06T18:18:52.5916192Z ##[debug]At D:\a_tasks\SendEmail_a41d805b-80c4-4b20-924d-b8d1cca9a43f\1.5.1\SendMail.ps1:97 char:5
2025-03-06T18:18:52.5929803Z ##[debug]+ Send-MailMessage @MailParams
2025-03-06T18:18:52.5944484Z ##[debug]+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2025-03-06T18:18:52.5958092Z ##[debug] + CategoryInfo : InvalidOperation: (System.Net.Mail.SmtpClient:SmtpClient) [Send-MailMessage], SmtpExcept ion
2025-03-06T18:18:52.5975665Z ##[debug] + FullyQualifiedErrorId : SmtpException,Microsoft.PowerShell.Commands.SendMailMessage
2025-03-06T18:18:52.5989054Z ##[debug]
2025-03-06T18:18:52.6055058Z ##[debug]Script stack trace:
2025-03-06T18:18:52.6056003Z ##[debug]at SendMailFromPipeline, D:\a_tasks\SendEmail_a41d805b-80c4-4b20-924d-b8d1cca9a43f\1.5.1\SendMail.ps1: line 97
2025-03-06T18:18:52.6072051Z ##[debug]at , D:\a_tasks\SendEmail_a41d805b-80c4-4b20-924d-b8d1cca9a43f\1.5.1\SendMail.ps1: line 103
2025-03-06T18:18:52.6085938Z ##[debug]at , : line 1
2025-03-06T18:18:52.6099903Z ##[debug]at , : line 22
2025-03-06T18:18:52.6113294Z ##[debug]at , : line 18
2025-03-06T18:18:52.6138231Z ##[debug]at , : line 1
2025-03-06T18:18:52.6144941Z ##[debug]Exception:
2025-03-06T18:18:52.9878344Z ##[debug]System.Net.Mail.SmtpException: Error in processing. The server response was: 5.7.3 STARTTLS is required to send mail [MN2PR01CA0045.prod.exchangelabs.com 2025-03-06T18:18:52.246Z 08DD5C8CA9C50352]
2025-03-06T18:18:52.9879703Z ##[debug] at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)
2025-03-06T18:18:52.9892556Z ##[debug] at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, MailAddress from, Boolean allowUnicode)
2025-03-06T18:18:52.9906356Z ##[debug] at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, Boolean allowUnicode, SmtpFailedRecipientException& exception)
2025-03-06T18:18:53.0049783Z ##[debug] at System.Net.Mail.SmtpClient.Send(MailMessage message)
2025-03-06T18:18:53.0050816Z ##[debug] at Microsoft.PowerShell.Commands.SendMailMessage.EndProcessing()
2025-03-06T18:18:53.0178056Z ##[error]Error in processing. The server response was: 5.7.3 STARTTLS is required to send mail [MN2PR01CA0045.prod.exchangelabs.com 2025-03-06T18:18:52.246Z 08DD5C8CA9C50352]
2025-03-06T18:18:53.0186751Z ##[debug]Processed: ##vso[task.logissue type=error]Error in processing. The server response was: 5.7.3 STARTTLS is required to send mail [MN2PR01CA0045.prod.exchangelabs.com 2025-03-06T18:18:52.246Z 08DD5C8CA9C50352]
2025-03-06T18:18:53.0195624Z ##[debug]Processed: ##vso[task.complete result=Failed]
2025-03-06T18:18:53.0422951Z ##[section]Finishing: Send an email with subject Azure Android Build

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions