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
Beshoy Wageh
NA
33
4.6k
The SMTP server requires a secure connection or the client w
Jan 16 2019 6:56 AM
public void SendVerificationLinkEmail(string emailID, string activationCode)
{
var verifyUrl = "/User/VerifyAccount/" + activationCode;
var link = Request.Url.AbsoluteUri.Replace(Request.Url.PathAndQuery, verifyUrl);
var fromEmail = new MailAddress("
[email protected]
", "beshooooo");
var toEmail = new MailAddress(emailID);
var fromEmailPassword = "********"; // Replace with actual password
string subject = "Your account is successfully created!";
string body = "<br/><br/>We are excited to tell you that your Dotnet Awesome account is" +
" successfully created. Please click on the below link to verify your account" +
" <br/><br/><a href='" + link + "'>" + link + "</a> ";
var smtp = new SmtpClient
{
Host = "smtp.gmail.com",
Port = 587,
EnableSsl = true,
DeliveryMethod = SmtpDeliveryMethod.Network,
UseDefaultCredentials = false,
Credentials = new NetworkCredential(fromEmail.Address, fromEmailPassword)
};
using (var message = new MailMessage(fromEmail, toEmail)
{
Subject = subject,
Body = body,
IsBodyHtml = true
})
smtp.Send(message);
}
Reply
Answers (
2
)
Ebook is not downloaded
Add multiple database to the config file?