diff --git a/src/client/Bootstrap.Client/Controllers/Api/InterfaceController.cs b/src/client/Bootstrap.Client/Controllers/Api/InterfaceController.cs index 30d336722dfa1077f304865c323fba73917aad98..9a5f717b7b37f283d04a172a5c0b502737ac59e5 100644 --- a/src/client/Bootstrap.Client/Controllers/Api/InterfaceController.cs +++ b/src/client/Bootstrap.Client/Controllers/Api/InterfaceController.cs @@ -56,12 +56,16 @@ namespace Bootstrap.Client.Controllers.Api var password = section.GetValue("Password", ""); var from = section.GetValue("From", ""); var to = section.GetValue("To", ""); + var port = section.GetValue("Port", 25); + var enableSsl = section.GetValue("EnableSsl", false); if (!string.IsNullOrEmpty(password)) { using var mailSender = new SmtpClient(smtpHost) { - Credentials = new NetworkCredential(from, password) + Credentials = new NetworkCredential(from, password), + Port = port, + EnableSsl = enableSsl }; await mailSender.SendMailAsync(from, to, title, message); } diff --git a/src/client/Bootstrap.Client/appsettings.Development.json b/src/client/Bootstrap.Client/appsettings.Development.json index 9e8fe519fad25e494bb9d8994e2dd162717fc55d..30955a4f9293baad04dd8bc896c8d06a8eca62cf 100644 --- a/src/client/Bootstrap.Client/appsettings.Development.json +++ b/src/client/Bootstrap.Client/appsettings.Development.json @@ -48,6 +48,8 @@ }, "SmtpClient": { "Host": "smtp.163.com", + "Port": 587, + "EnableSsl": true, "Password": "", "From": "honeywell_mes@163.com", "To": "argo@163.com" diff --git a/src/client/Bootstrap.Client/appsettings.json b/src/client/Bootstrap.Client/appsettings.json index 427b72d9df63bf7d23fc4f874c7ed7589785a172..804532fe9ba1df4adb733f7651a72412e5c29fc6 100644 --- a/src/client/Bootstrap.Client/appsettings.json +++ b/src/client/Bootstrap.Client/appsettings.json @@ -43,6 +43,8 @@ }, "SmtpClient": { "Host": "smtp.163.com", + "Port": 587, + "EnableSsl": true, "Password": "", "From": "honeywell_mes@163.com", "To": "argo@163.com"