Microsoft cloud engineer - SharePoint, Office 365, Azure, DotNet, Angular, JavaScript.
Microsoft cloud engineer - SharePoint, Office 365, Azure, DotNet, Angular, JavaScript.

How to send SMTP email with Power Automate Desktop (PAD)

Demo how to send SMTP email with Power Automate Desktop (PAD) including:

  • PAD example flow with attachment
  • PAD email step failure error
  • PowerShell to enable SMTP tenant level
  • Outlook web mail showing Inbox delivery success

535: 5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled for the Tenant. Visit https://aka.ms/smtp_auth_disabled

VIDEO

SCREENSHOT

POWERSHELL CODE – ENABLE SMTP TENANT

Install-Module ExchangeOnlineManagement
Import-Module ExchangeOnlineManagement
Connect-ExchangeOnline -UserPrincipalName spjeffdev@spjeffdev.onmicrosoft.com
Set-TransportConfig -SmtpClientAuthenticationDisabled $true

ERROR MESSAGE

535: 5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled for the Tenant. Visit https://aka.ms/smtp_auth_disabled for more information. [CH2PR05CA0070.namprd05.prod.outlook.com]: Microsoft.Flow.RPA.Desktop.Modules.SDK.ActionException: Failed to send email message. —> MailKit.Security.AuthenticationException: 535: 5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled for the Tenant. Visit https://aka.ms/smtp_auth_disabled for more information. [CH2PR05CA0070.namprd05.prod.outlook.com] —> MailKit.Net.Smtp.SmtpCommandException: 5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled for the Tenant. Visit https://aka.ms/smtp_auth_disabled for more information. [CH2PR05CA0070.namprd05.prod.outlook.com]
— End of inner exception stack trace —
at MailKit.Net.Smtp.SmtpClient.d__69.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MailKit.Net.Smtp.SmtpClient.Authenticate(Encoding encoding, ICredentials credentials, CancellationToken cancellationToken)
at MailKit.MailService.Authenticate(Encoding encoding, String userName, String password, CancellationToken cancellationToken)
at Microsoft.Flow.RPA.Desktop.Modules.Email.Actions.EmailActions.SendEmail(Variant from, Variant senderDisplayName, Variant to, Variant cc, Variant bcc, Variant subject, Variant body, Variant attachments, Variant smtpServer, Variant username, Variant varPassword, Boolean isBodyHtml, Int32 serverPort, Boolean needsAuthentication, Boolean enableSsl, Boolean acceptUntrustedCertificates)
— End of inner exception stack trace —
at Microsoft.Flow.RPA.Desktop.Modules.Email.Actions.SendEmail.Execute(ActionContext context)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary2 inputArguments, Dictionary2 outputArguments)

REFERENCES

© Copyright 2016
@ SPJeff

Return to Top ▲Return to Top ▲