Hi base on the below link <a class="postlink" href="https://itservices.usc.edu/office365/emailclients/">https://itservices.usc.edu/office365/emailclients/</a>
Office365 is using TLS Encryption Method and Port Number 587
It seems the SMTP client in Aspnetzero doesn't support TLS?
10 Answer(s)
-
0
Duplicate of #3962@b1758ffc-c5d6-4949-bfc8-a9bc10b108f6
-
0
The issue is here with MailKit, here is Connect that fixes the issue client.Connect( _smtpEmailSenderConfiguration.Host, _smtpEmailSenderConfiguration.Port, //_smtpEmailSenderConfiguration.EnableSsl SecureSocketOptions.Auto );
-
0
<cite>aaron: </cite> Duplicate of #3962@b1758ffc-c5d6-4949-bfc8-a9bc10b108f6
This is misleading answer. I should not change the code in order to make it work.
The very basic code I've tested worked perfectly!
SmtpClient client = new SmtpClient("smtp.office365.com", 587); client.UseDefaultCredentials = false; client.Credentials = new NetworkCredential("[mail]", [password]"); client.EnableSsl = true; MailMessage mailMessage = new MailMessage(); mailMessage.From = new MailAddress("[mail]"); mailMessage.To.Add("[email protected]"); mailMessage.Body = "body"; mailMessage.Subject = "subject"; client.Send(mailMessage);
Should I replace your code with this to make it work!
-
0
This is misleading answer.
No, I just pointed to another person's solution for the same issue.
I should not change the code in order to make it work.
The very basic code I've tested worked perfectly!
Should I replace your code with this to make it work!
If it works for you without any change, that's great.
-
0
Actually I am expecting a fix from your side. I think it should work without changing code and overriding the existing library.
-
0
Hi @Homam,
This is a problem of MailKit, we don't wnat to change its behaviour. Using the code you shared would be a better choice in this case.
-
0
The porblem has been fixed after upgrading to ABP 3.4. This was the solution ;)
-
0
Thanks for letting us know!
-
0
So may i know what is the ultimate method to use Office365 SMTP email using TLS?
<a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/Email-Sending">https://aspnetboilerplate.com/Pages/Doc ... il-Sending</a>
does it mean i should use
Abp.MailKit NuGet package
And replace the IMailKitSmtpBuilder interface with your own implementation
using the above code to config the smtp client ?
-
0
@itzoar2
<cite>Homam: </cite> The problem has been fixed after upgrading to ABP 3.4. This was the solution ;)