sendEmail method returns permission error

Hi,

I’m using the Javascript API and I wanted to send out an email via the API by calling

Backendless.Messaging.sendEmail( subject, bodyParts, recipients, attachments )

The automated emails (configuration emails, etc.) work just fine using a custom STMP server, so I assume that the email settings are correct.

I created a designated user for this purpose, but no matter what permissions I grant the user via the developer console (see image below) I get the following error:

error message - User has no permission to send email
error code - undefined

What am I missing here?

Hello @Benedikt_Peters

Welcome to the community!
Could you please check global permissions for sending emails

https://backendless.com/docs/js/users_global_permissions.html

Regards, Vlad

Hi @vladimir-upirov,

thanks for the fast reply.

This is what my security roles for AuthenticatedUser look like:

The picture I provided in my post above shows the permissions for the specific user under
Data → System Data → Users → Permissions → User Permissions

Benedikt

Hi @vladimir-upirov,

I found my mistake. I forgot to check the global permissions under “JSUser”.

Thank you for the tip.

How can I make sure, that no other user can send emails using the JS API, since there is no user permission for sending emails?

Benedikt

Edit: In hindsight, this is not how it is supposed to work, right?
I should be able to grant the user permission for sending emails under messaging → Permissions → User permissions.

But that option is not shown:

1 Like

Hello @Benedikt_Peters,

thank you for the good point, I have created an internal ticket to add permissions BKNDLSS-23462

Regards,
Sergey