Skip to main content

Send Mail Activity Failing using Azure Communication Services

Comments

4 comments

  • Gareth Evans

    Hey Jack Charde if you read into the error, it notes that 587 is typically used for plain text, not encrypted. It also notes that port 465 is what you want for SSL. 

    1
  • Jack Charde

    Hey Gareth,

    I did try a number of alterations before posting this (I should have mentioned that). I changed emailsettings.json to use 465 with “EnableSSL” set to both true and false, and neither worked.

    When I use port 465, and EnableSSL: true, I get the following error:

    "traces": [        "Error: 0: Unexpected Error: VertiGIS.Workflow.Runtime.Execution.Exceptions.ActivityExecutionException: [WF: Activity execution error] Failed to execute activity 12 with action gcx:wf:server::SendEmail: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.",        " ---> System.Net.Sockets.SocketException (10060): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.",        "   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)",        "   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)",        "   at System.Threading.Tasks.ValueTask.ValueTaskSourceAsTask.<>c.<.cctor>b__4_0(Object state)",        "--- End of stack trace from previous location ---",        "   at System.Threading.Tasks.TaskToAsyncResult.End(IAsyncResult asyncResult)",        "   at MailKit.Net.SocketUtils.SocketConnectState.OnEndConnect(IAsyncResult ar)",        "--- End of stack trace from previous location ---",        "   at MailKit.Net.SocketUtils.ConnectAsync(String host, Int32 port, IPEndPoint localEndPoint, CancellationToken cancellationToken)",        "   at MailKit.Net.SocketUtils.ConnectAsync(String host, Int32 port, IPEndPoint localEndPoint, Int32 timeout, CancellationToken cancellationToken)",        "   at MailKit.MailService.ConnectNetworkAsync(String host, Int32 port, CancellationToken cancellationToken)",        "   at MailKit.Net.Smtp.SmtpClient.ConnectAsync(String host, Int32 port, SecureSocketOptions options, CancellationToken cancellationToken)",        "   at VertiGIS.Workflow.Server.Activities.SendEmail.Execute(IDictionary`2 inputs, IActivityContext context)",        "   at VertiGIS.Workflow.Runtime.Execution.ActivityContext.ExecuteActivityHandler(IActivityHandler handler, IDictionary`2 inputs)",        "   --- End of inner exception stack trace ---",        "   at VertiGIS.Workflow.Runtime.Execution.ActivityContext.ExecuteActivityHandler(IActivityHandler handler, IDictionary`2 inputs)",        "   at VertiGIS.Workflow.Runtime.Execution.ActivityContext.ExecuteFinish(IActivityHandler handler, IDictionary`2 inputs)",        "   at VertiGIS.Workflow.Runtime.Execution.ActivityContext.ExecuteStart()",        "   at VertiGIS.Workflow.Runtime.Execution.AmbientState.ExecuteCurrentContext()",        "   at VertiGIS.Workflow.Runtime.Execution.AmbientState.Execute()",        "   at VertiGIS.Workflow.Runtime.Execution.Engine.Run(Program program, RunOptions options)",        "   at VertiGIS.Workflow.Hosts.Server.Host.RunWorkflow(String workflowJson, IDictionary`2 inputs, IDictionary`2 trivia, String accessToken, String portalUrl, CancellationToken cancellationToken)",        "   at VertiGIS.Workflow.Server.Foundation.WorkflowRunner.ProcessAsync(Object content)"      ]

    0
  • Jack Charde

    IT just told me that Azure Communication Services does not support port 465, but they do support port 25 with TLS and SMTP Authentication. I tried that port with EnableSSL: false, and it worked! Also, now 587 is working with EnableSSL: false. Not sure why it didn't work when I tried earlier, but it's good to go now.

    1
  • Gareth Evans

    Aha, glad you found success! 

    0

Please sign in to leave a comment.