Click to See Complete Forum and Search --> : problem with Mails while using localhost as SMTP server in ASP.NET


canuhelpme
December 16th, 2006, 04:33 AM
I am trying to send mails using C#.Presently i would like to use localhost as SMTP server.I have done it as follows

MailMessage mail = new MailMessage();
mail.To = "ankitha@global.west.edu";
mail.From = "Sumi@global.west.edu";
mail.BodyFormat = MailFormat.Text;
mail.Subject = "welcome message";
mail.Body = "Hearty welcome to our land";
SmtpMail.SmtpServer = "localhost"; //I tried with IP address of my system//
SmtpMail.Send(mail);
In addition to this i made some configurations to IIS server (SMTP virtual server) :I changed connection and relay to the IP of my machine.It is not working.Also i tried adding the IP as 127.0.0.1 but in vain.I am not getting any error messages.
But the mail i sent is found in the folder inetpub/mailroot/Queue.It is not available to the recepient.Do i have to take into account the mailaddresses of sender and receiver.Can i use any valid mailid's(yahoo.gmail......)?How to solve it?