Click here to Skip to main content
16,017,954 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# Directories whilst debugging in visual studio Pin
[d]eljay24-Jul-07 5:51
[d]eljay24-Jul-07 5:51 
GeneralRe: C# Directories whilst debugging in visual studio Pin
Luc Pattyn24-Jul-07 6:11
sitebuilderLuc Pattyn24-Jul-07 6:11 
GeneralDynamic adding, editing & deleting data from a datagrid Pin
AmitVikramSingh24-Jul-07 2:41
AmitVikramSingh24-Jul-07 2:41 
Questiona detour around an "input-synchronous call" Pin
Gjsonke24-Jul-07 2:15
Gjsonke24-Jul-07 2:15 
QuestionSerialize a web serive into a c# class Pin
buzzby24-Jul-07 1:52
buzzby24-Jul-07 1:52 
AnswerRe: Serialize a web serive into a c# class Pin
BoneSoft24-Jul-07 3:52
BoneSoft24-Jul-07 3:52 
AnswerRe: Serialize a web serive into a c# class Pin
MidwestLimey24-Jul-07 4:13
professionalMidwestLimey24-Jul-07 4:13 
QuestionUsing SMTP for sending emails Pin
sandman8824-Jul-07 1:47
sandman8824-Jul-07 1:47 
Hello, I'm developing an application that sends an email via smtp. I work in XP professional and C#. I'm using the library System.Net.Mail for this. But I can't send messages, the code:

public static void SendEmail(string srv, string from, string to, string usr, string pwd)
{
MailMessage oMsg = new MailMessage();
MailAddress send = new MailAddress(from);
MailAddress rcpt = new MailAddress(to);
oMsg.To.Add(rcpt);
oMsg.Sender = send;
oMsg.From = send;
oMsg.ReplyTo = send;
oMsg.IsBodyHtml = true;
oMsg.Body = Functions.GenerateEmail();
oMsg.Subject = "Prove";
SmtpClient smtp = new SmtpClient();
smtp.Host = srv;
smtp.Port = 25;
smtp.Credentials = new System.Net.NetworkCredential(usr, pwd);
try
{
smtp.Send(oMsg);
}
catch (SmtpException exc)
{
MessageBox.Show(exc.Message);
}
}

But an exception is generated, the server wasn't founded.

I prove the same in Windows Vista Home Premium and the same code sends the email.

I need a solution, thanks!!
AnswerRe: Using SMTP for sending emails Pin
originSH24-Jul-07 1:53
originSH24-Jul-07 1:53 
AnswerRe: Using SMTP for sending emails Pin
Luc Pattyn24-Jul-07 1:56
sitebuilderLuc Pattyn24-Jul-07 1:56 
GeneralRe: Using SMTP for sending emails Pin
sandman8824-Jul-07 2:14
sandman8824-Jul-07 2:14 
GeneralRe: Using SMTP for sending emails Pin
Luc Pattyn24-Jul-07 2:38
sitebuilderLuc Pattyn24-Jul-07 2:38 
AnswerRe: Using SMTP for sending emails Pin
Guffa24-Jul-07 1:59
Guffa24-Jul-07 1:59 
AnswerRe: Using SMTP for sending emails Pin
Vasudevan Deepak Kumar24-Jul-07 2:07
Vasudevan Deepak Kumar24-Jul-07 2:07 
GeneralRe: Using SMTP for sending emails Pin
sandman8824-Jul-07 2:41
sandman8824-Jul-07 2:41 
GeneralRe: Using SMTP for sending emails Pin
ekynox24-Jul-07 3:12
ekynox24-Jul-07 3:12 
QuestionCustom setup like project- Visual Studio SDK Pin
ceejeeb24-Jul-07 1:36
ceejeeb24-Jul-07 1:36 
AnswerRe: Custom setup like project- Visual Studio SDK Pin
kubben24-Jul-07 2:08
kubben24-Jul-07 2:08 
GeneralRe: Custom setup like project- Visual Studio SDK Pin
ceejeeb24-Jul-07 2:16
ceejeeb24-Jul-07 2:16 
QuestionSorting Multiple columns On gridview Pin
kibromg24-Jul-07 1:32
kibromg24-Jul-07 1:32 
AnswerRe: Sorting Multiple columns On gridview Pin
kubben24-Jul-07 2:11
kubben24-Jul-07 2:11 
GeneralRe: Sorting Multiple columns On gridview Pin
kibromg24-Jul-07 3:51
kibromg24-Jul-07 3:51 
GeneralRe: Sorting Multiple columns On gridview Pin
kubben24-Jul-07 3:54
kubben24-Jul-07 3:54 
GeneralRe: Sorting Multiple columns On gridview Pin
kibromg24-Jul-07 4:06
kibromg24-Jul-07 4:06 
GeneralRe: Sorting Multiple columns On gridview Pin
kubben24-Jul-07 4:13
kubben24-Jul-07 4:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.