email sending issue @yahoo.com on using godaddy.com

Mar 7 2017 6:15 AM
string smtphost = "relay-hosting.secureserver.net";
string smtpusername = ConfigurationManager.AppSettings["SMTPUSERNAME"];
string smtppwd = ConfigurationManager.AppSettings["SMTPPASWORD"];
string FromTo = ConfigurationManager.AppSettings["From"];
string From_CC = ConfigurationManager.AppSettings["CC"];
System.Text.StringBuilder strs = new System.Text.StringBuilder();
MailMessage objMail = new MailMessage(FromTo, txtEmail.Text.Trim(), "Welcome", str);
objMail.CC.Add(new MailAddress(From_CC));
objMail.IsBodyHtml = true;
SmtpClient s = new SmtpClient(smtphost);
System.Net.NetworkCredential basicAuthenticationInfo = new System.Net.NetworkCredential(smtpusername, smtppwd);
s.UseDefaultCredentials = false;
s.Credentials = basicAuthenticationInfo;
s.Send(objMail);

Answers (4)