User invitation emails not sending

Hi, We are successfully tunning Squidex CMS on a Linux server. We are using Google SMTP settings in appsettings.json, but emails are not sending when we invite a user. Instead we now need to go to Administration and create the user and also a password and send that on to the user.

Is there anywhere else we need to configure to send mail?

regards

TIaan

I don’t think so. No logs or so?

Apologies:

"type": "System.Net.Http.HttpRequestException",
Apr 30 16:38:08 ip-xxx-xx-x-xxxxx.eu-west-1.compute.internal xxxxxxxxcms[32365]: "stackTrace": "   at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.DiagnosticsHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task\u00601 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
   at Squidex.ClientLibrary.Authenticator.GetBearerTokenAsync()
   at Squidex.ClientLibrary.CachingAuthenticator.GetBearerTokenAsync()
   at Squidex.ClientLibrary.Utils.AuthenticatingHttpClientHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task\u00601 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
   at Squidex.ClientLibrary.SquidexClientBase.RequestJsonAsync[T](HttpMethod method, String path, HttpContent content, QueryContext context, CancellationToken ct)
   at Squidex.Areas.Api.Controllers.News.Service.FeaturesService.GetFeaturesAsync(Int32 version) in /home/amz/Workspace/swarm/xxxxxxxxx/xxxxxxxxxxxxxxx/backend/src/Squidex/Areas/Api/Controllers/News/Service/FeaturesService.cs:line 57
   at Squidex.Areas.Api.Controllers.News.NewsController.GetLanguages(Int32 version) in /home/amz/Workspace/swarm/xxxxxxxxxxx/xxxxxxxxxxxx/backend/src/Squidex/Areas/Api/Controllers/News/NewsController.cs:line 47
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.\u003CInvokeActionMethodAsync\u003Eg__Awaited|12_0(ControllerActionInvoker invoker, ValueTask\u00601 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.\u003CInvokeNextActionFilterAsync\u003Eg__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State\u0026 next, Scope\u0026 scope, Object\u0026 state, Boolean\u0026 isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.\u003CInvokeInnerFilterAsync\u003Eg__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.\u003CInvokeNextExceptionFilterAsync\u003Eg__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ExceptionContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State\u0026 next, Scope\u0026 scope, Object\u0026 state, Boolean\u0026 isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.\u003CInvokeNextResourceFilter\u003Eg__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State\u0026 next, Scope\u0026 scope, Object\u0026 state, Boolean\u0026 isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.\u003CInvokeFilterPipelineAsync\u003Eg__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.\u003CInvokeAsync\u003Eg__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.\u003CInvoke\u003Eg__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at NSwag.AspNetCore.Middlewares.OpenApiDocumentMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)
   at Squidex.Web.Pipeline.EnforceHttpsMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) in /home/amz/Workspace/swarm/xxxxxxxxxxxx/xxxxxxxxxxxxxxxxx/backend/src/Squidex.Web/Pipeline/EnforceHttpsMiddleware.cs:line 45
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.\u003C\u003Ec__DisplayClass5_1.\u003C\u003CUseMiddlewareInterface\u003Eb__1\u003Ed.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Squidex.Web.Pipeline.LocalCacheMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) in /home/amz/Workspace/swarm/xxxxxxxxxxxx/xxxxxxxxxxxxxxx/backend/src/Squidex.Web/Pipeline/LocalCacheMiddleware.cs:line 32
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.\u003C\u003Ec__DisplayClass5_1.\u003C\u003CUseMiddlewareInterface\u003Eb__1\u003Ed.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Squidex.Web.Pipeline.RequestLogPerformanceMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) in /home/amz/Workspace/swarm/xxxxxxxx/xxxxxxxxxxxx/backend/src/Squidex.Web/Pipeline/RequestLogPerformanceMiddleware.cs:line 48
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.\u003C\u003Ec__DisplayClass5_1.\u003C\u003CUseMiddlewareInterface\u003Eb__1\u003Ed.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Builder.Extensions.MapWhenMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Builder.Extensions.MapWhenMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Builder.Extensions.MapWhenMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication\u00601 application)"

This is from a http request. It cannot be related to your issue. But it seems that your instance cannot communicate with squidex cloud (it reads the newest features from there).

So perhaps your email server is not reachable as well?

You can also test the background process:

I tried there. It is by default set to below:
43

If I start it, it run for a small time and then sets back to the II position

I found this thread, but saw you ended the thread without mentioning where that was

The bug icon should be clickable.

System.Net.Mail.SmtpException: Syntax error, command unrecognized. The server response was:
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(Exception source)
at System.Net.Mail.SmtpConnection.ConnectAndHandshakeAsyncResult.End(IAsyncResult result)
at System.Net.Mail.SmtpTransport.EndGetConnection(IAsyncResult result)
at System.Net.Mail.SmtpClient.ConnectCallback(IAsyncResult result)
— End of stack trace from previous location where exception was thrown —
at Squidex.Domain.Apps.Entities.History.Notifications.NotificationEmailSender.SendEmailAsync(String emailSubj, String emailBody, IUser assigner, IUser assignee, String appName) in /home/amz/Workspace/swarm/xxxxxxxxx/xxxxxxxxxxxx/backend/src/Squidex.Domain.Apps.Entities/History/Notifications/NotificationEmailSender.cs:line 81
at Squidex.Domain.Apps.Entities.History.Notifications.NotificationEmailEventConsumer.On(Envelope1 event) in /home/amz/Workspace/swarm/xxxxxxxxxx/xxxxxxxxx/backend/src/Squidex.Domain.Apps.Entities/History/Notifications/NotificationEmailEventConsumer.cs:line 110 at Squidex.Infrastructure.EventSourcing.Grains.EventConsumerGrain.DispatchConsumerAsync(Envelope1 event) in /home/amz/Workspace/swarm/xxxxxxxxxxxxxx/xxxxxxxxxxxxxx/backend/src/Squidex.Infrastructure/EventSourcing/Grains/EventConsumerGrain.cs:line 247
at Squidex.Infrastructure.EventSourcing.Grains.EventConsumerGrain.<>c__DisplayClass12_0.<b__0>d.MoveNext() in /home/amz/Workspace/swarm/xxxxxxxxxxxxx/xxxxxxxxxxxxx/backend/src/Squidex.Infrastructure/EventSourcing/Grains/EventConsumerGrain.cs:line 91
— End of stack trace from previous location where exception was thrown —
at Squidex.Infrastructure.EventSourcing.Grains.EventConsumerGrain.DoAndUpdateStateAsync(Func`1 action, String caller) in/home/amz/Workspace/swarm/xxxxxxxxxxxxx/xxxxxxxxxxxxx/backend/src/Squidex.Infrastructure/EventSourcing/Grains/EventConsumerGrain.cs:line 200

Perhaps POP3 vs SMTP or so?

We use SMTP smtp.gmail.com

Perhaps a port issue? Sorry, I have no real idea, just thinking about potential issues.

tried 587 as port as well.

“email”: {
“smtp”: {
/*
* The host name to your email server.
/
“server”: “smtp.gmail.com”,
/

* The sender email address.
/
“sender”: "name@domain.com",
/

* The username to authenticate to your email server.
/
“username”: "name@domain.com",
/

* The password to authenticate to your email server.
/
“password”: “********”,
/

* Always use SSL if possible.
*/

    "enableSsl": true,
    /*
     * The port to your email server.
     */
    "port": 587 
  },

Can you confirm that the port entry should not be closed by ,

Yes, this should not matter … it is json.

If you want, you can PM me your email details to your server and I can debug it. You could also try 465.

done. I have sent you testing credentials which you can use.

1 Like