TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Guest User
Tech Writer
2.1k
474.4k
SMTP Server requires a secure connection or client
Apr 27 2020 12:44 PM
I am having this issue each time when i try to register new users to my web application. Here is the logic.
<connectionStrings>
<add name=
"DefaultConnection"
connectionString=
"Data Source=GcobaniM-L\SQLEXPRESS;Initial Catalog=eNtsaRegistration;Integrated Security=True"
providerName=
"System.Data.SqlClient"
/>
</connectionStrings>
public
Task SendAsync(IdentityMessage message)
{
// Plug in your email service here to send an email.
var mailMessage =
new
MailMessage();
mailMessage.To.Add(
new
MailAddress(message.Destination));
mailMessage.From =
new
MailAddress(
"
[email protected]
"
);
mailMessage.Subject = message.Subject;
mailMessage.IsBodyHtml =
true
;
mailMessage.Body = message.Body;
using
(var smtp =
new
SmtpClient())
{
var credential =
new
NetworkCredential
{
UserName =
"
[email protected]
"
,
Password =
"***"
};
smtp.Host =
"smtp.gmail.com"
;
smtp.Port = 587;
smtp.EnableSsl =
true
;
smtp.UseDefaultCredentials =
false
;
smtp.Credentials = credential;
smtp.Send(mailMessage);
}
return
Task.FromResult(0);
}
}
Reply
Answers (
2
)
save data in view using store procedure
How to: Set default path to ASP.Net Core routing