Yes it stopped working again :-/
I just try resent the same email with same recipients and attachement, so strange…
But when I use CURL and easy API call withou attachement, the SMTP works well.
Could be some problem on JS… I will try more debugs and let you know.
Thanks for new logging ticket.
Definitely this issue is related with Attachments in sendmail. My attachment its simple PDF file (24KB) stored on Backendless File just before email sending.
could you try sending an email to my email address?
YES, I just did it. It seems nothing delivered (I have a CC to my email)
Are you 100% sure that the problem is not with the SMTP server itself? Could it be it is rejecting emails with attachments? Or somehow fails to deliver them?
I am not pointing fingers, simply gathering information for now.
yes, I am sure becouse some email passed (the same size 24KB).
I see where could be a problem:
- I save the attachement to Backendless Files and I got response its saved
- then I call sendEmail with reference to this file
I think that after save file action the file is not ready for Email attachement…
Do you immediately send email after the file is uploaded? If the time gap is short, the file may not be fully synchronized across our cluster. That would explain why some emails are not delivered. Could you add a 3-5 seconds delay after a file is uploaded?
1 Like
Yes, that could be a problem.
Tomorrow morning I will try to add delay in pur source code and will let you know.
Thank you.
Thanks! I am curious if it will help. Let us know.
Hello @mark-piller I tried to upgrade my code with huge debug. Unfortunately delay between save file and send email with this file attachement does not help
I tied the delay up to 30s without success.
Then I tried debug Backendless.js library to find Message ID. Then I checked the message status via API call and I found this response according status SCHEDULED
:
{"errorMessage":"IOException while sending message","messageId":"mail:5F9CA41C-8214-2B16-FF3F-EA2CEFA9C100","status":"failed"}
Would you please investigate this issue on your side?
Thank you
PS: I also add a comment to GIHUB for Backendless JS-SDK see Send email response by stanislav-grin · Pull Request #87 · Backendless/JS-SDK · GitHub
@vladimir-upirov @mark-piller another strange thing. After a while the IOException
error message dismiss and I got just response:
{
“errorMessage”: “Could not find status for message with id: mail:5F9CA41C-8214-2B16-FF3F-EA2CEFA9C100”,
“messageId”: “mail:5F9CA41C-8214-2B16-FF3F-EA2CEFA9C100”,
“status”: “unknown”
}
Unfortunately email is not sent.
Hi @Martin_Krajcir1,
I have fixed the response of the sendEmail
method in v6.2.4 of the JS SDK.
Could you please update it and let us know if this solves your issue with messageId?
Thanks!
Regards,
Stanislaw
@stanislaw.grin yes, it works perfect! Thank you.
@mark-piller now we need to solve issue with message status:
{“errorMessage”:“IOException while sending message”,“messageId”:“mail:B9472A4D-0BB5-C6E4-FFE3-6CFA7553DA00”,“status”:“failed”}
Hi Martin,
There should be some log message in the log files in the /logging
folder in the File service. Could you please try sending an email again and hopefully we should see an error there?
Regards,
Mark
Hi @mark-piller
I reporduce the problem again and again.
Output from sendEmail()
{“messageId”:“mail:C6DC19AB-0C69-6458-FF9B-9B049DC10900”,“errorMessage”:null,“status”:“SCHEDULED”}
Output from check status:
{“errorMessage”:“IOException while sending message”,“messageId”:“mail:C6DC19AB-0C69-6458-FF9B-9B049DC10900”,“status”:“failed”}
There is no new log in /logging
File folder. Current file log is without new line.
I changed the log level in your app so we could possibly get more info in the logs. Could you please try again?
I have the IOException
but still notking in log file. Also Real-Time logging is empty.
I wrote a program in Java that uses the same API (it doesn’t matter if it is Java or JS, the backend is the same) and I have been sending email to myself with an attachment. I get every single one of them.
Could you please point out a file I could attach and an email to send it to? I will run another test
Good idea, here is my file for email attachement https://backendlessappcontent.com/3551EF8F-C241-7579-FF0D-45ECE827AF00/4F2A2235-85A7-4B58-A3EB-1F1B8B55097C/files/faktury/202103/202103099.pdf
Email sent. I put both your and my email addresses. I got the email message. Did you?