0 LIKES LikeUnLike
i am a beginner programmer of same technology. I have a problem . I want to send email through C# code but i am getting error. On send button click I have simply writtten the code:private void btnSend_Click(object sender, System.EventArgs e){MailMessage mail = new MailMessage();mail.To = txtTo.Text;mail.From = txtFrom.Text;mail.Subject = txtSubject.Text;mail.Body = txtBody.Text;SmtpMail.SmtpServer = "localhost"; SmtpMail.Send(mail);}but I am getting following Error:System.Runtime.InteropServices.COMException: The transport failed to connect to the server. How to fix this error? Waiting for your reply
Tags: .net, 1.1, asp.net, email, Sending, Using
Report (0) (0) | 12 years, 9 month(s) ago
Latest activity: 14 years, 11 month(s) ago. This question has 2 answers.