I have successfully tested and used 2 different custom email servers in development mode. When I publish my App into production mode, attempts to send email (from template) from messaging service fail and email is never received by the recipient. As admin, I then get failure notification from Backendless regarding the failed email. Message Exception is always: “Invalid Addresses”. It works OK in DEV mode, but not in PROD. How can I prevent this from happening?
I attempted to send a test email from your application with the AppID DEC6B808-645B-7B62-FF97-8D7C3B617700, and indeed, the email was not received. However, I am able to receive emails successfully from other applications, which suggests that everything on our side seems to be working correctly.
The “Invalid Addresses” error you are seeing in the logs is not an issue on our end; it reflects the response we received from your mail server. I recommend checking the configuration of your mail server to ensure it’s functioning properly.
Additionally, could you clarify what you mean by DEV and PROD in this context? Are these the same application environments, or do you have another one where the email settings are working fine? Generally, the email service does not have specific “dev” or “prod” modes, and email functionality should not depend on whether the app is published or not.
The log file (you can see it in the /logging directory in the Files section) contains the following:
2025-02-24 01:59:56,198 | Global logger | ERROR | Send custom template 'Client_TY_CSA' for 'nathan@seXXXXXXe.com' was failed : Invalid Addresses
2025-02-24 01:59:56,201 | Global logger | ERROR | Result of sending messages using the template 'Client_TY_CSA' totalCount/failedCount:1/1 : Failed emails:
nathan@seXXXXXXe.com
2025-02-24 01:59:57,808 | SMTP Logger | ERROR | Error occurred during template-based email sending. Subject 'New Client Account Welcome'. Recipients [rmunger@eiXXXXXXXe.com]. Email template 'Client_TY_CSA' : Invalid Addresses
2025-02-24 01:59:57,816 | Global logger | ERROR | Send custom template 'Client_TY_CSA' for 'rmunger@eiXXXXXXXe.com' was failed : Invalid Addresses
2025-02-24 01:59:57,820 | Global logger | ERROR | Result of sending messages using the template 'Client_TY_CSA' totalCount/failedCount:1/1 : Failed emails:
rmunger@eiXXXXXXXe.com
The Invalid Addresses error comes from outlook (the SMPT server you configured). All Backendless can do here is to log the error, the problem is somewhere on the outlook (or the configuration) side. Here’s what chatGPT had to say about it:
Mark, normally I would have believed your diagnosis to be the case except that when email is sent to the domain defined to the application, the email is then allowed to pass the network security. When email is sent to all other outside domains fail with “invalid address”. My own email address does not belong to the application domain. My email address receives email from development server, but email fails when the app is in production server.
The email servers are not the problem. It is the network security.
DEV means development.backendless.com, using template email testing platform.
PROD means the location where the APP is published.
Recipient email address works in dev mode to any domain. This uses same email server as in PROD mode.
When testing in PROD server using SAME email server, only email addresses with same domain as the APP will receive email. Other email addresses get flagged as “invalid address”.
Regardless of where the app is published our server uses the same configuration you provided to communicate with the SMPT server. If the SMTP server responds with an error, we log it. I am not clear on what else we can do.
So this situation begs the question as to why email addresses matching the app domain can receive email, but other email sent to other domains receive errors. This situation is normally an issue for the Cisco (or other) networking team to resolve.
So why does the testing from the email template test-send feature work from the DEV platform? Same email server, same recipient email address, same app, email sent to non-app domains are received from DEV platform, fail from PROD platform. This suggests security settings on the Backendless routers are not allowing non-domain access in prod mode.
Could you clarify what you call DEV and what you mean by PROD.
Also, if you could record a loom video that demonstrates where it works and where it doesn’t work, it would significantly help us understand the scenario.
The client has two email servers, 1 at Microsoft and 1 at GoDaddy. When the MS server is used, we receive the “invalid address” messages from non-domain emails. When GoDaddy server is used, we receive error 421: too many concurrent SMTP connections.
In my code, I have the code try to send email in a retry loop, stopping the loop when success is reached or a count of 3. I suspect the GoDaddy server is counting the failed 1st and 2nd attempts.
Thank you for the clarification. I am still having a difficulty understanding what Backendless has to do with an error that is returned from a third party server.
The way in which the errors were being produced pointed to possible problems with the security gateway at the Backendless end of the connection. The errors made it look as if the security gateway was only allowing outbound traffic for the backendless domains and for the app’s specified domain. On the outside, this logic made sense, but thank you for proving this theory incorrect.
Once an SMTP configuration is added, all requests to send email or send email using a template go through the SMTP provider. We do not apply any restrictions on these calls whatsoever.