cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow: Mail Task can't send email correctly because of "login with the given credentials failed."

Former Member

context:

I tried to use the new function of workflow -- Mail Task on SAP Cloud Platform, although I did the configuration as the help documents( Mail Destination&Configure Mail destination&Configure Mail Task) required, but I still got error.

Task:

I have connected the mail task to the required flow elements.

Destination:

Error Message:

Addition:

I confirm that I enter the right Username and Password for this configuration.

Tks for your patience. If you have any suggestion, please let me know when you feel free.

Best Regards,

Joy Lee

Accepted Solutions (1)

Accepted Solutions (1)

tobias_breyer
Contributor

Hi Joy,

GMail/Google considers all applications not supporting OAuth2 insecure, which is why the login procedure is not successful in your case.

You can disable the respective setting, see https://support.google.com/accounts/answer/6010255?hl=en

Regards,

Tobias

SAP Cloud Platform Workflow, Development

Former Member
0 Kudos

Hi Tobias,

Tks for your help.

It does work as your suggest!

Best Regards,

Joy

Former Member
0 Kudos

Hi Tobias,

I still have a question about Mail Task destination configuration:

When I changed the "Name" of the destination to "Session", the workflow will be erroneous:

Could you please explain is "bpmworkflowruntime_mail" a default name of Mail Task desitination?

tobias_breyer
Contributor
0 Kudos

Currently, only one destination is supported and it has that predefined name bpmworkflowruntime_mail. Refer to the respective administration guide section (which is also linked in the page describing the modeling artifact):

https://help.sap.com/viewer/f85276c5069a429fa37d1cd352785c25/Cloud/en-US/5c7a8431ccbd4b83b74b2776469...

Former Member
0 Kudos

I got it. Thanks for your help!

I'm looking forward to see there are more functions about SAP Cloud Platform Workflow service!

gregorw
Active Contributor
0 Kudos

Hi tobias.breyer,

I also try to configure the GMail SMTP server for the SCP Workflow service. Unfortunately I run in the same issue as described by Joy. I'm using the parameters from Send email from a printer, scanner, or app. But I get also the error:

"Could not send email: The server 'smtp.gmail.com' could be reached, but the login with the given credentials failed. Verify that the credentials are valid for the server."

As I'm using Second Factor Authentication (2FA) with my GMail account I did use an App Password that can be setup at https://myaccount.google.com/apppasswords. That works fine on my Linux system and also my Multi Functional Printer. But it doesn't work on the SCP Workflow service. I hope that you can investigate this.

Best regards
Gregor

gregorw
Active Contributor

It seems to be an Issue with the GMail Server. I've just tried via my Office365 account using the description Option 1 (recommended): Authenticate your device or application directly with an Office 365 mailbox,.... Also here I use 2FA and was able to set a App Password at https://account.activedirectory.windowsazure.com/AppPasswords.aspx

tobias_breyer
Contributor

Hi Gregor,

unfortunately, all the free mail providers have their own special topics for which we just can give you pointers.

Reading up on the page you provided, you might want to check the "insecure apps" flag.

The following error codes are returned by GMail. Maybe they help you.

With 2FA (probably):

535 5.7.8 https://support.google.com/mail/?p=BadCredentials

Without 2FA (probably):

534-5.7.14 <https://accounts.google.com/signin/[...] Please log in via your web browser and
534-5.7.14 then try again.
534-5.7.14 Learn more at
534 5.7.14 https://support.google.com/mail/answer/78754

Or maybe it is just a typo in the password?

Regards,

Tobias

shivamshukla12
Contributor
0 Kudos

Outlook server is still a issue for me but smtp-gmail is working quite good ... thanks to community.

Thanks,

Shivam

Answers (3)

Answers (3)

MajoMartinez
Advisor
Advisor

Hi!

This error happened to me while using Workflows Service in the Coud Foundry environment. I was entering my credentials in the right way but still wasn't working as I had this error "Could not send email: The server 'smtp.gmail.com' could be reached, but the login with the given credentials failed. Verify that the credentials are valid for the server."

Besides enabling access to less secure apps, I enabled my account in the "Password Incorrect" tab here https://accounts.google.com/DisplayUnlockCaptcha, and now it is working 🙂

Yes this works. Thanks..

SaranyaSampath
Participant
0 Kudos

Hi,

I am also facing same issue while trying from my company ID. Any solution ?

Thanks in advance

Saranya

Utkarsh
Participant
0 Kudos

Hi tobias.breyer, mariajosemq741,

Any particular setting for outlook emails?

We are also facing a similar issue - "Could not send email: The server 'smtp-mail.outlook.com' could be reached, but the login with the given credentials failed. Verify that the credentials are valid for the server.".

Thanks in advance!

Utkarsh

tobias_breyer
Contributor
0 Kudos

Hi Utkarsh,

Please refer to this guided answer, in case you have access to the SAP support portal:

https://ga.support.sap.com/dtp/viewer/index.html#/tree/2622/actions/36618:36734:37154:37156:38307

You should look for features which are called app-password or similar. They often solve the issue when credentials do not seem to work. I don't know whether they exist for outlook.com, though.

Best regards,

Tobias

Utkarsh
Participant
0 Kudos

I will check tobias.breyer. But my point is that these mail notifications will be flowing to all the users in an org. So we can't really expect all the users to do this config right? Is there any SAP recommended approach we can follow?

tobias_breyer
Contributor

Hi Utkarsh,

There is only a single mail account for which this needs to be done.

The mail destination is a singleton per sub-account. In the mail destination, you can only configure one credential, it is the one of the mail sender. The mail recipients are not involved here.

Also note that sender address (from field) and login user name typically need to match (not necessarily identical, but point to the same account). For many mail providers, you cannot arbitrarily choose the sender address.

So you need to do that configuration at most once per sub-account where there is a subscription to workflow.

Best regards,

Tobias

Utkarsh
Participant
0 Kudos

Thanks Tobias. I will consult the client along the same lines.

shivamshukla12
Contributor
0 Kudos

Hi Utkarsh ,

Did you solve it ?

thanks,

Shivam

Utkarsh
Participant
0 Kudos

Yes Shivam. We got support from the client's infra team based on Tobias's feedback.