Error sending email: Invalid URI a port was expected

Error sending email: Invalid URI a port was expected

  
Hi All,

When our application tries to send an email, it keeps generating error message: 
 
1.     "Error creating Email. The remote server returned an error: (500) Internal Server Error." 
2.     "Invalid URI: A port was expected because of there is a colon (':') present but the port could not be parsed."
 
The problem is that only one particular espace is generating that error when sending an email, I’ve created a couple of espace to test the sending of email on the same server and it works well.
 
Any ideas on what might be the cause of error?
 
Thanks in advance!
 
Paulo
Hi Paulo,

Sorry for the late answer :( this one passed under our radars...

Are you still having this issue?
Do you have a trace of the error that you can share?
Do you have errors in all emails on that eSpace or on a particular one?

Cheers

Hi Andre,

Sorry for the late reply as well.

Unfortunately, I'm still having this issue.

The error occurs once the espace tries to send an email, please see above post for the error message generated in the service center.

We only have the error on that particular espace, while the other espace works fine when sending email.

Appriciate any thoughts or help.

Many thanks!

Paulo
Can you past here the complete error details from service center?
Hi André

There are three message generated from service center when the error occurs, please see the following:

[1] Exception of type 'System.Web.HttpUnhandledException' was thrown.
Stack:
   at System.Web.UI.Page.HandleError(Exception e)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at ASP.batchnotif_preapproved_aspx.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
(Continues in 6a59c697-da61-4fd1-b8be-f5f374794470)
-Env

[2] Invalid URI: A port was expected because of there is a colon (':') present but the port could not be parsed.
Stack:
(Inner Exception of 9d8ded77-cc16-4ced-b583-718268d06884)
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
   at OutSystems.HubEdition.RuntimePlatform.Email.EmailHelper.#l5(Uri request, String filename, String hostName)
   at OutSystems.HubEdition.RuntimePlatform.Email.EmailHelper.#pjb1.#zkb(Match match)
   at System.Text.RegularExpressions.RegexReplacement.Replace(MatchEvaluator evaluator, Regex regex, String input, Int32 count, Int32 startat)
   at System.Text.RegularExpressions.Regex.Replace(String input, MatchEvaluator evaluator)
   at OutSystems.HubEdition.RuntimePlatform.Email.EmailHelper.#i5(Uri path, String fileContent, String hostName)
   at OutSystems.HubEdition.RuntimePlatform.Email.EmailHelper.#m5(String fileContent, Uri path, HashSet`1 doneList, String hostName)
   at OutSystems.HubEdition.RuntimePlatform.BasePage.AddLocalInlineCss(String path, String currentInlineCss, HashSet`1 doneList, String hostName)
   at OutSystems.HubEdition.WebWidgets.OSPage.GetInlineCss(String HostName)
   at ssNTMA.Flows.FlowEnrollment.ScrnBatchNotif_PreApproved.OnPreRenderComplete(EventArgs e)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Invalid URI: A port was expected because of there is a colon (':') present but the port could not be parsed.
Stack:
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
   at OutSystems.HubEdition.RuntimePlatform.Email.EmailHelper.#l5(Uri request, String filename, String hostName)
   at OutSystems.HubEdition.RuntimePlatform.Email.EmailHelper.#pjb1.#zkb(Match match)
   at System.Text.RegularExpressions.RegexReplacement.Replace(MatchEvaluator evaluator, Regex regex, String input, Int32 count, Int32 startat)
   at System.Text.RegularExpressions.Regex.Replace(String input, MatchEvaluator evaluator)
   at OutSystems.HubEdition.RuntimePlatform.Email.EmailHelper.#i5(Uri path, String fileContent, String hostName)
   at OutSystems.HubEdition.RuntimePlatform.Email.EmailHelper.#m5(String fileContent, Uri path, HashSet`1 doneList, String hostName)
   at OutSystems.HubEdition.RuntimePlatform.BasePage.AddLocalInlineCss(String path, String currentInlineCss, HashSet`1 doneList, String hostName)
   at OutSystems.HubEdition.WebWidgets.OSPage.GetInlineCss(String HostName)
   at ssNTMA.Flows.FlowEnrollment.ScrnBatchNotif_PreApproved.OnPreRenderComplete(EventArgs e)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Thanks!

Paulo
Do you have any inline css on this email screen? What is it that makes this email screen different from the others that work fine?
Yes there are some css on the email screen. Then, I've tried to create a simple email screen that doesn't have css or other actions, just a simple one that will send an email. Unfortunately, it doesn't work as well.

I think that as long as the email were sent from that particular espace and server, that is when the error occurs.

Also, another thing that I've found out is when I created a new espace on that server the email works perfectly fine. So it thinks it has nothing to do with the server configuration/settings.

Lastly, in this case I have 2 server for Prod & Dev with that same espace. The espace in the Dev server works fine, Therefore, the error only occurs in the Prod server.

I've been thingking to try to republish the espace. First is I will delete it from the servicecenter then publish it again. Maybe, the platform will treat it as a new espace plus the settings will be back to default.

Any thoughts?

Thanks!

Paulo
From the error stack it appears to be a problem with CSS processing. Do you have imports in your css at any level theme, screen, web blocks?
It may happen that in the dev environment those imports are working and that in production you have them blocked for some reason.
Hi André

Thank you very much for your response, it seems that the css is really the one causing the error. When I tried to comment this line, background: url('image'). After that, the email functionality works fine :)

Again, thanks a lot!

Paulo