hi friends...
i m new in c#.net..
i m going to develop some basic application like sending email from my application...
i got some code from internet...
but i m facing problem regarding setting of SMTP server..
can anybudy tell how to find out SMTP server name of our local machine...
plz anybudy help is any related url or any code plz share with me...........

namespace WebMail
class Class1
static void Main(string[] args)
MailMessage oMsg = new MailMessage();
// TODO: Replace with sender e-mail address.
oMsg.From = "i_prashant11@rediffmail.com";
// TODO: Replace with recipient e-mail address.
oMsg.To = "indapure.prashant@gmail.com";
oMsg.Subject = "Send Using Web Mail";

// SEND IN HTML FORMAT (comment this line to send plain text).
oMsg.BodyFormat = MailFormat.Html;

// HTML Body (remove HTML tags for plain text).
oMsg.Body = "<HTML><BODY><B>Hello World!</B></BODY></HTML>

// TODO: Replace with the name of your remote SMTP server.SmtpMail.SmtpServer = "MySMTPServer";//how to find SMTP server name of our local macine

oMsg = null;
//oAttch = null;
catch (Exception e)
Console.WriteLine("{0} Exception caught.", e);

Thanks in advance.

Prashant Indapure

Edited by happygeek: fixed formatting

8 Years
Discussion Span
Last Post by jozcar@yahoo.co

If your local host address does not work, try the ip address of your server, this off course would work if the default smtp is install on your machine

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.