"Send Mail" error in MS Office 365 Scope

Hi all, I am getting the below run time error in send mail. It seems to complain about the tenant id, but that tenant id is correct.

Microsoft.Graph.ServiceException: Code: generalException
Message: An error occurred sending the request.
—> Microsoft.Identity.Client.MsalServiceException: AADSTS900023: Specified tenant identifier ‘dd5b5d42-c0d3-4ad2-b5f1-60edb3af277’ is neither a valid DNS name, nor a valid external domain.
Trace ID: 36916da3-6bf0-4456-ae6e-6d5ad3496d00
Correlation ID: f053d635-061b-4b58-bc2c-7d91019442c3
Timestamp: 2022-11-08 01:31:22Z
at Microsoft.Identity.Client.Internal.Requests.RequestBase.d__24.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at UiPath.MicrosoftOffice365.Activities.Mail.SendMail.d__54.MoveNext()
— End of stack trace from previous location where exception was thrown —
at UiPath.Shared.Activities.AsyncTaskCodeActivityImplementation.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at UiPath.Shared.Activities.AsyncTaskCodeActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

Hi @Bearcats96

we have to give the email with domain name. From error I feel Domain name is missing while giving the email ID


@Anil_G Domain name is not required for send mail in O365 Scope. As you see from the below send mail activity, there is no place to enter a domain name

Hi @Bearcats96 ,

Sorry to confuse you. WHen I said domain name I was referring to adding @domain.com in the account section


Thanks @Anil_G. The domain name is there in the email ID under account. What exactly are you referring to?

HI @Bearcats96

Please confirm if You are giving tenant ID , Application ID and if the authentication type is username and password then in username with have to give complete email id with domain name(example@uipath.com). if application and secret then we have to give the app secret as well along with others


@Anil_G I use “application and secret” authentication, and I did see all three parameters (application ID, application secret, and tenant ID) are populated.

Hi @Bearcats96

Please make sure those values are proper and given to correct fields. If so , then Environment can be ‘Global’ and the services make sure to select ‘Mail’

PS : often people confuse between tenant ID and App ID and populate them in wrong fields. One possibility


Looks like the tenant id was indeed missing one digit in the end after checking with our info sec team. It’s now working.

Thanks @Anil_G for your time!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.