| | |
Regarding Sending Mail from C#.net
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Apr 2008
Posts: 3
Reputation:
Solved Threads: 0
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
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
Hi there Pash11, you may find the following URL useful:
Hope this helps!
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!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
![]() |
Similar Threads
- sending sms using vb.net (VB.NET)
- PHP E-mail setting ??? (PHP)
- problem in sending mail form web application (ASP.NET)
- mail being sent from my computer (Viruses, Spyware and other Nasties)
- Obtain Remote Assistance by Sending an E-mail Message in Windows XP (Windows tips 'n' tweaks)
- Obtain Remote Assistance by Sending an E-mail Message in Windows XP (Windows tips 'n' tweaks)
Other Threads in the C# Forum
- Previous Thread: Downloading Speed
- Next Thread: Saving text manipulated data
| Thread Tools | Search this Thread |
.net access algorithm array asp.net barchart bitmap box broadcast c# check checkbox client combobox control conversion csharp custom database databaseconnection datagrid datagridview dataset datetime dbconnection degrees design development draganddrop drawing encryption enum event eventhandlers excel file firefox form format forms function gdi+ grantorrevokepermissionthroughc#.net httpwebrequest image index input install java label libraries list listbox loop mandelbrot marshalbyrefobject math mouseclick movingimage mysql mysql.data.client operator path photoshop picturebox pixelinversion platform post programming radians regex remote remoting resourcefile richtextbox server sleep socket sql statistics stream string system.servicemodel table tcpclientchannel text textbox thread time timer update usercontrol validation visualstudio webbrowser windows winforms wpf wpfc# xml






