| I was trying to send email using ASP.NET 2.0 using the following code: MailMessage message = new MailMessage(); message.From = new MailAddress("iamazam@hotmail.com"); message.To.Add(new MailAddress("azamsharp@gmail.com")); message.Subject = "This is my subject"; message.Body = "This is the content"; SmtpClient client = new SmtpClient(); client.Host = "localhost"; client.Send(message); but I keep getting the error: Failure sending mail.Unable to connect to the remote server The bad thing is that there is no documentation available which tells that how you can send an email using localhost as your default server. There was a huge problem in ASP.NET 1.X with the CDONTS thingy and now this error. Why is'nt there a simple solution which let's you send a simple email? powered by IMHO |
Print | posted @ Wednesday, December 21, 2005 7:53 PM