C# Email sending error on Godaddy server

后端 未结 3 1834
遥遥无期
遥遥无期 2021-01-22 02:39

I have one web application which hosted on Godaddy server. I am stuck with Failure sending mail error. I place my code here

public void Mailing()
{
 MailMess         


        
3条回答
  •  春和景丽
    2021-01-22 03:13

    Check the code below. You have to change client.Host = "smtpout.secureserver.net."

    MailMessage msg = new MailMessage(txtemail.Text, "shopover@vibrantinfosystems.com");
    msg.Subject = "Contact Us";
    string body = "Name: " + txtname.Text.Trim() + "";
    body += "
    Email:" + txtemail.Text + ""; body += "

    Subject :" + txtsubject.Text + ""; body += "

    Message : " + txtmessage.Text + ""; msg.Body = body; msg.IsBodyHtml = true; SmtpClient client = new SmtpClient(); client.Host = "smtpout.secureserver.net."; client.Send(msg); client.Timeout = 10000; ClientScript.RegisterStartupScript(GetType(), "alert", "alert('Mail Sent Successfully!!');", true);

提交回复
热议问题