Regarding Sending Mail from C#.net

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2008
Posts: 3
Reputation: pash11 is an unknown quantity at this point 
Solved Threads: 0
pash11 pash11 is offline Offline
Newbie Poster

Regarding Sending Mail from C#.net

 
0
  #1
Apr 24th, 2008
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)
{
try
{
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
SmtpMail.Send(oMsg);

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



Thanks in advance.

Prashant Indapure
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 1,293
Reputation: majestic0110 has a spectacular aura about majestic0110 has a spectacular aura about majestic0110 has a spectacular aura about 
Solved Threads: 67
majestic0110's Avatar
majestic0110 majestic0110 is offline Offline
Nearly a Posting Virtuoso

Re: Regarding Sending Mail from C#.net

 
0
  #2
Apr 24th, 2008
Hi there Pash11, you may find the following URL useful:

Hope this helps!
If you have a quality, be proud of it and let it define you. Add it to the world!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 4
Reputation: gangu.madduri is an unknown quantity at this point 
Solved Threads: 1
gangu.madduri gangu.madduri is offline Offline
Newbie Poster

Re: Regarding Sending Mail from C#.net

 
0
  #3
May 2nd, 2008
i guess for the local machine you can always give 127.0.0.1,
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 3
Reputation: jozcar@yahoo.co is an unknown quantity at this point 
Solved Threads: 0
jozcar@yahoo.co's Avatar
jozcar@yahoo.co jozcar@yahoo.co is offline Offline
Newbie Poster

Re: Regarding Sending Mail from C#.net

 
0
  #4
May 3rd, 2008
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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC