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
Adhikar Patil
NA
481
127.6k
How to Send Email Without using password in Asp.Net
Oct 29 2018 5:46 AM
Hi,
Can you give me solutions for How to send email without password in Asp.Net. Below is my code
string to = "
[email protected]
";
string from = "
[email protected]
";
MailMessage message = new MailMessage(from, to);
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("<table>");
sb.AppendFormat("<tr><td>Name:</td><td>{0}</td></tr>", txtName.Text.Trim());
sb.AppendFormat("<tr><td>Email:</td><td>{0}</td></tr>", txtEmail.Text.Trim());
sb.AppendFormat("<tr><td>Phone No</td><td>{0}</td></tr>", txtPhoneNo.Text.Trim());
sb.AppendFormat("<tr><td>Organisation:</td><td>{0}</td></tr>", txtOrganisation.Text.Trim());
sb.Append("<table>");
message.Subject = "BDS Contacted by " + txtName.Text;
message.Body = sb.ToString();
//message.BodyEncoding = Encoding.UTF8;
message.IsBodyHtml = true;
SmtpClient client = new SmtpClient("smtp.gmail.com", 587);
System.Net.NetworkCredential basicCredential1 = new
client.EnableSsl = true;
client.UseDefaultCredentials = false;
client.Credentials = basicCredential1;
try
{
client.Send(message);
}
catch (Exception ex)
{
throw ex;
}
Reply
Answers (
1
)
RSA encryption in Javascript and decryption in C#.
Get top salary of 10 employees using aso.mvc and jason data