Want to build the ChatGPT based Apps? Start here
Become a member
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
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
Ajad Patel
2.1k
75
4k
Email sending problem
Dec 28 2017 2:53 AM
Hello sir
I am sending mail during I get error which I mention below.
"Bad sequence of commands. The server response was: This mail server requires authentication when attempting to send to a non-local e-mail address. Please check your mail client settings or contact your administrator to verify that the domain or address is defined for this serve
And My code is:
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
SmtpClient smtpClient = new SmtpClient();
string msg = string.Empty;
try
{
MailAddress fromAddress = new MailAddress(SenderEmail);
message.From = fromAddress;
message.To.Add(Email);
message.Subject = " Registration Details";
message.IsBodyHtml = true;
// message.Body = "Email ID is: " + Email;
message.Body = "Email ID is: ";
smtpClient.Host = HostName;
smtpClient.Port = PortNumber;
smtpClient.EnableSsl = false;
smtpClient.UseDefaultCredentials = false;
smtpClient.Credentials = new System.Net.NetworkCredential(UserName, Password);
smtpClient.Send(message);
}
catch (Exception ex)
{
}
Reply
Answers (
6
)
Cannot implicitly convert System.Collections.Generic.List to
inventory project with barcode reader and GST