10 TIPs - To Become a Good Developer/Programmer
Why Join
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
Ruchita Sirondiya
2.1k
50
4.4k
Emails not sending from smtp.zoho.com in c#
Apr 4 2019 6:19 AM
I am using ZOHO mail server for sending mails through my application. But it gives following error -
"TheSMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required."
my code -
MailMessage msg =
new
MailMessage();
msg.To.Add(
new
MailAddress(
"xxx@xx.com"
));
msg.Bcc.Add(
new
MailAddress(
"xxx@xx.com"
));
msg.From =
new
MailAddress(
"xxx@xx.com"
,
"Test mail"
);
msg.Subject =
"send mail"
;
msg.Body =
"test MAIL...."
;
msg.IsBodyHtml =
true
;
SmtpClient client =
new
SmtpClient();
client.Host =
"smtp.zoho.com"
;
client.Credentials =
new
System.Net.NetworkCredential(
"xx@xx.com"
,
"XXX"
);
client.Port = 587;
client.EnableSsl =
true
;
client.Send(msg);
please give a solution ..
Reply
Answers (
4
)
how to set focus on particular panel ?
continous deployment using Azure devops release pipeline