Base solution for your next web application
Open Closed

An attempt was made to access a socket in a way forbidden by its access permissions. #10188


User avatar
0
TimMackey created

ANZ version 8.1.0 angular/.net core

When attempting to register a new user, the following error occurs with Release builds. Debug builds to not report the error. Error from "Logs.txt":

ERROR 2021-03-21 10:11:42,888 [9    ] Mvc.ExceptionHandling.AbpExceptionFilter - An attempt was made to access a socket in a way forbidden by its access permissions. 127.0.0.1:25
System.Net.Internals.SocketExceptionFactory+ExtendedSocketException (10013): An attempt was made to access a socket in a way forbidden by its access permissions. 127.0.0.1:25
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(Exception source)
   at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
   at MailKit.Net.SocketUtils.ConnectAsync(String host, Int32 port, IPEndPoint localEndPoint, Boolean doAsync, CancellationToken cancellationToken)
   at MailKit.Net.SocketUtils.ConnectAsync(String host, Int32 port, IPEndPoint localEndPoint, Int32 timeout, Boolean doAsync, CancellationToken cancellationToken)
   at MailKit.MailService.ConnectSocket(String host, Int32 port, Boolean doAsync, CancellationToken cancellationToken)
   at MailKit.Net.Smtp.SmtpClient.ConnectAsync(String host, Int32 port, SecureSocketOptions options, Boolean doAsync, CancellationToken cancellationToken)
   at MailKit.Net.Smtp.SmtpClient.Connect(String host, Int32 port, SecureSocketOptions options, CancellationToken cancellationToken)
   at Abp.MailKit.DefaultMailKitSmtpBuilder.ConfigureClient(SmtpClient client)
   at ngTTM.Net.Emailing.ngTTMMailKitSmtpBuilder.ConfigureClient(SmtpClient client) in C:\Users\Tim\Documents\__ngTTMv810\ngTTM\aspnet-core\src\ngTTM.Core\Net\Emailing\ngTTMMailKitSmtpBuilder.cs:line 20
   at Abp.MailKit.DefaultMailKitSmtpBuilder.Build()
   at Abp.MailKit.MailKitEmailSender.BuildSmtpClient()
   at Abp.MailKit.MailKitEmailSender.SendEmailAsync(MailMessage mail)
   at Abp.Net.Mail.EmailSenderBase.SendAsync(MailMessage mail, Boolean normalize)
   at ngTTM.Authorization.Users.UserEmailer.ReplaceBodyAndSend(String emailAddress, String subject, StringBuilder emailTemplate, StringBuilder mailMessage) in C:\Users\Tim\Documents\__ngTTMv810\ngTTM\aspnet-core\src\ngTTM.Core\Authorization\Users\UserEmailer.cs:line 360
   at ngTTM.Authorization.Users.UserEmailer.SendEmailActivationLinkAsync(User user, String link, String plainPassword) in C:\Users\Tim\Documents\__ngTTMv810\ngTTM\aspnet-core\src\ngTTM.Core\Authorization\Users\UserEmailer.cs:line 124
   at Abp.Threading.InternalAsyncHelper.AwaitTaskWithPostActionAndFinally(Task actualReturnValue, Func`1 postAction, Action`1 finalAction)
   at ngTTM.Authorization.Users.UserRegistrationManager.RegisterAsync(String name, String surname, String emailAddress, String userName, String plainPassword, String webPageUrl, Boolean tosAcceptance, Boolean isInvitee, Boolean isVerified, Boolean isEmailConfirmed, String emailActivationLink) in C:\Users\Tim\Documents\__ngTTMv810\ngTTM\aspnet-core\src\ngTTM.Core\Authorization\Users\UserRegistrationManager.cs:line 110
   at ngTTM.Authorization.Accounts.AccountAppService.Register(RegisterInput input) in C:\Users\Tim\Documents\__ngTTMv810\ngTTM\aspnet-core\src\ngTTM.Application\Authorization\Accounts\AccountAppService.cs:line 302
   at lambda_method(Closure , Object )
   at Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable.Awaiter.GetResult()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__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& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)

2 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @timmackey

    In production, AspNet Zero sends an email when a new user is registered. It seems like you haven't configured the SMTP settings for your app. You can configure it under Administration > Settings menu.

  • User Avatar
    0
    TimMackey created

    Configuring email settings resolved this issue.