40
Views
12
Comments
Email is not working
Question

Hi team , 
I am getting the below error when i am trying the send the email to the registered user in my application 

Error creating Email. The underlying connection was closed: The connection was closed unexpectedly. 

2018-12-10 12-16-21
Goncalo Duarte Almeida

Hello @Prem Angappan 

Please, In Service Center, go to Monitoring > Errors. Click "Detail" on the error. Look for a "Stack Trace." It might reveal if the error is happening during the Connect phase or the Authenticate phase. 

If you can, shre the log in order we can gou deeper.

UserImage.jpg
Prem Angappan




Goncalo Duarte Almeida

Please find the below message as there is no stack trace. 



Message: Error creating Email. The underlying connection was closed: The connection was closed unexpectedly.

Environment InformationeSpaceVer: Id=4646, PubId=0, CompiledWith=11.22.0.39859RequestUrl: https://maiyar.qcc.gov.ae/Maiyar/moduleservices/log?clientTimeInMillis=1773397883585 (Method: POST)AppDomain: /LM/W3SVC/1/ROOT/Maiyar-118-134178619060157204FilePath: D:\...\PS\running\Maiyar.0377067907\ClientIp: 10.79.44.231 X-Forwarded-For: 10.79.45.19Locale: en-USDateFormat: yyyy-MM-ddPID: 3544 ('w3wp', Started='2/27/2026 10:45:16 AM', Priv=1410Mb, Virt=2120542Mb)TID: 71Thread Name:.NET: 4.0.30319.42000Client Runtime Packages: client-runtime-core= 3.33.0;client-runtime-view-framework-react= 3.10.0;client-runtime-widgets= 3.15.0;Client-Side Log

StackAction Name: SendCreateGroupUserMailEndpoint: screenservices/UserMangement_CW/ServiceAPISendCreateGroupUserMail System.Exception: Error creating Email. The underlying connection was closed: The connection was closed unexpectedly.    at Object.s [as getException] (https://maiyar.qcc.gov.ae/Maiyar/scripts/OutSystems.js?EhsMqL9pM_HmXeF8zbDIkQ:2:10241)    at c.onSuccess (https://maiyar.qcc.gov.ae/Maiyar/scripts/OutSystems.js?EhsMqL9pM_HmXeF8zbDIkQ:3:7240)    at XMLHttpRequest. (https://maiyar.qcc.gov.ae/Maiyar/scripts/OutSystems.js?EhsMqL9pM_HmXeF8zbDIkQ:3:2648)


2018-12-10 12-16-21
Goncalo Duarte Almeida

@Prem Angappan 

Check this page in service center.


Here should appear error instead sent, please click inside and check info.

UserImage.jpg
Prem Angappan

@Goncalo Duarte Almeida  We cant able to find the logs in this logs page.before that itself we are getting the error message. 



2018-12-10 12-16-21
Goncalo Duarte Almeida
UserImage.jpg
Prem Angappan

Hi @Goncalo Duarte Almeida   Please find the Below error message and log in the errors tab
For reference please check the first screenshot in the above chat. 

Message: Error creating Email. The underlying connection was closed: The connection was closed unexpectedly.

Environment InformationeSpaceVer: Id=4646, PubId=0, CompiledWith=11.22.0.39859RequestUrl: https://maiyar.qcc.gov.ae/Maiyar/moduleservices/log?clientTimeInMillis=1773397883585 (Method: POST)AppDomain: /LM/W3SVC/1/ROOT/Maiyar-118-134178619060157204FilePath: D:\...\PS\running\Maiyar.0377067907\ClientIp: 10.79.44.231 X-Forwarded-For: 10.79.45.19Locale: en-USDateFormat: yyyy-MM-ddPID: 3544 ('w3wp', Started='2/27/2026 10:45:16 AM', Priv=1410Mb, Virt=2120542Mb)TID: 71Thread Name:.NET: 4.0.30319.42000Client Runtime Packages: client-runtime-core= 3.33.0;client-runtime-view-framework-react= 3.10.0;client-runtime-widgets= 3.15.0;Client-Side Log

StackAction Name: SendCreateGroupUserMailEndpoint: screenservices/UserMangement_CW/ServiceAPISendCreateGroupUserMail System.Exception: Error creating Email. The underlying connection was closed: The connection was closed unexpectedly.    at Object.s [as getException] (https://maiyar.qcc.gov.ae/Maiyar/scripts/OutSystems.js?EhsMqL9pM_HmXeF8zbDIkQ:2:10241)    at c.onSuccess (https://maiyar.qcc.gov.ae/Maiyar/scripts/OutSystems.js?EhsMqL9pM_HmXeF8zbDIkQ:3:7240)    at XMLHttpRequest. (https://maiyar.qcc.gov.ae/Maiyar/scripts/OutSystems.js?EhsMqL9pM_HmXeF8zbDIkQ:3:2648)

 

2018-12-10 12-16-21
Goncalo Duarte Almeida


This is appening only in Production?

Previouly already worked?

What changes?


UserImage.jpg
Prem Angappan

This is appening only in Production? 
Yes we are able to reproduce only in the production

Previouly already worked? 

Yes sometimes it is working and this issue is intermittently happening 


What changes?

No recent changes done. 

2018-12-10 12-16-21
Goncalo Duarte Almeida

Intermittent errors in a production environment could be also  infrastructure or resource constraints, not code bugs, making it difficult to identify a pattern.

What you can do is add some logging actions to view in the Service Center -> General trying to find out where the failure occurred.

UserImage.jpg
Saicharan

Looks like this is not with the code but with the configuration at the environment level. 

Please check if this helps.

Service Center → Administration → Email: set SMTP server, port, and auth. Click “Send Test Email” there to reproduce and view the exact stack trace in Monitoring → Error Log (filter Source=eSpaceName, Type=Email). Also check General and Integration logs for TLS or DNS hints.

Thanks,

Saicharan

2018-12-10 12-16-21
Goncalo Duarte Almeida

If this were a configuration issue, then all emails should be failing, which is not what's happening. The problem is intermittent, and the logs provided so far are too general to help identify the root cause.

2026-03-20 01-28-51
Saugat Biswas

Hi @Prem Angappan 

The first and most important step is to understand what the error actually conveys:

Error:

  • Error creating Email.
  • The underlying connection was closed: The connection was closed unexpectedly.

This error does not originate in the UI or client runtime. It is thrown by the server‑side email sending process when OutSystems tries to open or maintain a connection to the SMTP server and that connection is terminated before completion.

This exact message is widely documented in OutSystems as a network / transport‑level failure, not a logic or code defect. 

Please refer to the discussion link here. This might give you more context.

Best

Saugat

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.