我已经建立了一个反馈页面。我正在尝试从该页面发送邮件。客户端为我提供了SMTP Server
名称Email ID
和Password
.但是当我尝试从该页面发送邮件时,我收到以下错误。
连接尝试失败,因为连接方在一段时间后没有正确响应,或者连接失败,因为连接的主机没有响应 64.37.118.141:25
这是我的代码
MailMessage feedBack = new MailMessage();
//feedBack.To.Add("master@myclient.com");
feedBack.From = new MailAddress("master@myclient.com");
feedBack.Subject = "Mail from Explor Corporate Website.";
feedBack.Body = "Sender Name: " + Name.Text + "<br/><br/>Sender Last Name:"+LastName.Text+"<br/><br/>Sender Company:"+Company.Text+"<br/><br/>Sender Designation"+Designation.Text+"<br/><br/>Sender Email:"+Email.Text+"Sender Phone No:"+ PhoneNo.Text+"Sender Enquiry:"+Enquiry.Text;
feedBack.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.myclient.com"; //Or Your SMTP Server Address
//smtp.Port = 587;
smtp.EnableSsl = true;
smtp.Credentials = new System.Net.NetworkCredential("master@myclient.com", "*****");
//Or your Smtp Email ID and Password
smtp.Send(feedBack);
谁能帮我解决这个问题?
欢迎任何建议。