Emails cannot be send through template: code":8002,"message":"Could not parse request with message: , status code 404

Good afternoon,

We have a problem with sending emails through an email template, we receive the below error:

What can cause this error?

Hi, @Michel_Loriaux

You need to change the method from GET to POST. Here’s a link to documentation that can help you create a request

Send Emails with Templates API - Backendless REST API Documentation

Regards,
Marina

Hi Marina,

I am using codeless template:

How do i change the method from Get to POST here?

@Michel_Loriaux, unfortunately I was unable to reproduce the issue in my apps. Could you please provide the full cURL that you sending? Also if you can create a page with minimal logic on which we can make checks themselves it will help us to establish your problem

Regards,
Marina

Hi Marina,

App id = 45D74295-8B81-D693-FF49-5EC08E970C00
When you go to preview and login with username Dnn04bhr and password 1111 then you can login.
In the top of the page you find:

image

then you arrive in the test page:
image

pagename is dnntestemail

curl ‘https://rapidwork.backendless.app/api/emailtemplate/send’
-H ‘Accept: /’
-H ‘Accept-Language: en-US,en;q=0.9,nl;q=0.8’
-H ‘Connection: keep-alive’
-H ‘Content-Type: application/json’
-H ‘Cookie: user-auth-cookie-45D74295-8B81-D693-FF49-5EC08E970C00=74DE5960-B2D3-4E05-AD85-FB92E0F398BB’
-H ‘Origin: https://rapidwork.backendless.app’
-H ‘Referer: https://rapidwork.backendless.app/api/files/ui-builder/containers/INLOG_II/index.html?page=dnntestemail&data={}’
-H ‘Sec-Fetch-Dest: empty’
-H ‘Sec-Fetch-Mode: cors’
-H ‘Sec-Fetch-Site: same-origin’
-H ‘User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36’
-H ‘sec-ch-ua: “Google Chrome”;v=“107”, “Chromium”;v=“107”, “Not=A?Brand”;v=“24”’
-H ‘sec-ch-ua-mobile: ?0’
-H ‘sec-ch-ua-platform: “Windows”’
-H ‘user-token: 74DE5960-B2D3-4E05-AD85-FB92E0F398BB’
–data-raw ‘{“addresses”:[“email@gmail.com”],“cc-addresses”:[“email@gmail.com”],“uniqueEmails”:true,“template-name”:“maandoverzichtakkoord”,“template-values”:{“maand”:0,“naambeheerder”:0,“emailakkoord”:0,“username”:0}}’
–compressed

Hi, @Michel_Loriaux

Do you still have the issue? I could not reproduce it in your app as well.
The request was sent through the steps you indicated above:

curl 'https://rapidwork.backendless.app/api/emailtemplate/send' \


  --data-raw '{"addresses":["jmlorxxxxx@gmail.com"],"cc-addresses":["jmlorxxxxxx@gmail.com"],"uniqueEmails":true,"template-name":"maandoverzichtakkoord","template-values":{"maand":0,"naambeheerder":0,"emailakkoord":0,"username":0}}' \
  --compressed

Response I got was succeess:

{"messageId":"mail:a1f2f2cc-1691-4800-adf9-b21593629661","errorMessage":null,"status":"SCHEDULED","sendingTimeInMillis":null,"successfulSendsAmount":null,"failedSendsAmount":null}

Regards,
Marina

Hi Marina,

Yes the issue is still there, can you try now again?
I get that same response when a mail is not send, for example with the emailaddress i have set now.

Hi @Michel_Loriaux ,

This is really strange behavior since I just tried to send test email from preview page of your app (as you described above) and there were no problem with it. Tried different browsers but still everything worked smoothly.

What browser do you use? I am interested in browser name and version.

Regards, Andriy

Hi @Andriy_Konoz,

Thanks for checking. The problem is that we don’t receive a email on this emailaddress. We are using the Google Chrome browser

image

@Michel_Loriaux ,

The problem is that we don’t receive a email on this email address

Then it is different problem since topic was created for 404 error on making “send email” request from the browser. There could be several reasons why you do not receive an email from your app:

  1. SMTP in your app is not properly configured. To check this moment you can go to your SMTP settings, fill password field and click “Test Connection” button.
  2. There is a problem during email sending. This can be checked by checking (sorry for tautology ) message status. In your case endpoint for checking message status is https://rapidwork.backendless.app/api/messaging/{messageId}. Message ID can be found in a response of .../send route in messageId field.

Checked sending one more time and also checked status of sent message - there were no problems in my case.

Could you please check your SMTP settings?

Regards, Andriy

Hi @Andriy_Konoz,

When i do the SMTP test then it shows me the test is passed:

When i check the messageid, i get this:

@Michel_Loriaux ,

Maybe you receive it to the Spam folder? Have you tried to send a letter to the different email?

Regards, Andriy

Hello @Andriy_Konoz,

No we did not receive it in the Spam folder. We found out yesterday that there were several email addresses not receiving the email. The one gmail email address we tried has the same error message, but does get send.

@Michel_Loriaux ,

About checking message status. Message ID in your case looks strange. It should be something like that mail:e5dc6557-df89-4d67-92cc-6544e6925759

About the problem itself. Our QA also tried to send email to their email from test page which you have provided and there again was no problem email was sent and received.

We found out yesterday that there were several email addresses not receiving the email

It seems to be problem with specific mail servers where those emails are created.
There are no errors in logs on our side. Also during the checks by our QA test emails were sent and received without any problems.

Regards, Andriy

1 Like

Hi @Andriy_Konoz

We will check with the email provider. Thanks for your help.

Hi @Andriy_Konoz,

We tried three different SMTP’s but the problem remained, we found out that because of an URL in the custom mail template somehow the mails where not send to the recipients. So now we removed the URL from the mail but in another Backendless app we do the same thing, the only difference is that we refer to a custom domain instead of a backendless.app domain.

Hello @Michel_Loriaux,

Unfortunately I wasn’t able to reproduce this issue.
I tried to

  1. send email from your app to the different email addresses
  2. tried to duplicate the email template to my app and send from my app to the different emaill addresses

Both cases worked without issues.

the mails where not send to the recipients

Could you please clarify, if any of the recipients received the email? or nobody received it at all?

Hi Olha,

The custom template which gave errors was:
image

The emails were correctly send to gmail email addresses, the company email addresses did not receive the emails.

Hello @Michel_Loriaux,

I have tried to send this email template to my company email (not gmail) and I received it. It means that Backendless sends emails correctly, the problem might be somewhere in the SMTP server.