Base solution for your next web application
Open Closed

SMTP Email User Null #3737


User avatar
0
jdavis01 created

I have updated my AspNetZero Template to the latest 4.3.1 MVC Core, Jquery, .Net 4.6.1

I am once again not able to send emails on this newer version. Previously I had this issue and I was able to resolve it by changing the UserEmailer.cs file in the Core project to implement ISMTPEmailSender instead of IEmaileSender.

Here is the link to my post on how I fixed it. #3353@c298aafa-2468-4ece-a07a-5bdd53d021f6

Here is the error:

ERROR 2017-08-18 11:21:07,043 [11   ] Mvc.ExceptionHandling.AbpExceptionFilter - The SMTP server does not support authentication.
System.NotSupportedException: The SMTP server does not support authentication.
   at MailKit.Net.Smtp.SmtpClient.Authenticate(Encoding encoding, ICredentials credentials, CancellationToken cancellationToken)
   at MailKit.MailService.Authenticate(String userName, String password, CancellationToken cancellationToken)
   at Abp.MailKit.DefaultMailKitSmtpBuilder.ConfigureClient(SmtpClient client)
   at Abp.MailKit.DefaultMailKitSmtpBuilder.Build()
   at Abp.MailKit.MailKitEmailSender.BuildSmtpClient()

So I removed all Credentials and now I am back to the UserName is Null..

ERROR 2017-08-18 11:25:16,012 [32   ] Mvc.ExceptionHandling.AbpExceptionFilter - Setting value for 'Abp.Net.Mail.Smtp.UserName' is null or empty!
Abp.AbpException: Setting value for 'Abp.Net.Mail.Smtp.UserName' is null or empty!
   at Abp.Net.Mail.EmailSenderConfiguration.GetNotEmptySettingValue(String name)
   at Abp.Net.Mail.Smtp.SmtpEmailSenderConfiguration.get_UserName()
   at Abp.MailKit.DefaultMailKitSmtpBuilder.ConfigureClient(SmtpClient client)
   at Abp.MailKit.DefaultMailKitSmtpBuilder.Build()

Is smtp server authentication required ??
Is there another implementation ?

this application is an internal app and will run on private servers with a notification server inside the firewall. there is no authentication configured and uses port 25.

I am pulling my hair out on this one.. Seems simple but has me held up badly..

Can you advise?


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

    hi

    when you can check the SmtpEmailSender class, there's the input parameter ISmtpEmailSenderConfiguration. In this interface you can set EnableSsl=false and UseDefaultCredentials = true. This way authentication will not be done.

    <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/master/src/Abp/Net/Mail/Smtp/SmtpEmailSender.cs">https://github.com/aspnetboilerplate/as ... lSender.cs</a>

  • User Avatar
    0
    jdavis01 created

    Sorry it took me so long to get back..

    I simply changed all IEmailSender to ISmtpEmailSender and changed the namespace from Abp.Net.Mail to Abp.Net.Mail.Smtp and all is well .

    Thank you so much for the support. Its always in the details..