Click here to Skip to main content
15,914,379 members
Home / Discussions / C#
   

C#

 
AnswerRe: DEPLOYMENT OF PROJECT Pin
Christian Graus2-Nov-07 20:49
protectorChristian Graus2-Nov-07 20:49 
GeneralRe: DEPLOYMENT OF PROJECT Pin
sindhutiwari2-Nov-07 20:52
sindhutiwari2-Nov-07 20:52 
GeneralRe: DEPLOYMENT OF PROJECT Pin
sindhutiwari2-Nov-07 20:58
sindhutiwari2-Nov-07 20:58 
GeneralRe: DEPLOYMENT OF PROJECT Pin
Christian Graus2-Nov-07 22:50
protectorChristian Graus2-Nov-07 22:50 
GeneralRe: DEPLOYMENT OF PROJECT Pin
sindhutiwari2-Nov-07 22:53
sindhutiwari2-Nov-07 22:53 
QuestionCan I do Windows and Web application in one project? Pin
ashwinibhalerao2-Nov-07 20:14
ashwinibhalerao2-Nov-07 20:14 
AnswerRe: Can I do Windows and Web application in one project? Pin
Christian Graus2-Nov-07 20:49
protectorChristian Graus2-Nov-07 20:49 
QuestionValidating the credential while sending mail Pin
M. J. Jaya Chitra2-Nov-07 19:53
M. J. Jaya Chitra2-Nov-07 19:53 
Hai Everybody,

I have used the following code to send the mail using the System.Net.Mail namespace:

 string host = "192.168.0.22";<br />
            int port = 85;<br />
            string userid = "un";<br />
            string password = "pwd";<br />
<br />
            MailMessage message = BuildMessage();<br />
<br />
            SmtpClient smtp = new SmtpClient(host, port);<br />
            smtp.Credentials = new NetworkCredential(userid, password);<br />
            smtp.SendCompleted += new SendCompletedEventHandler(smtp_SendCompleted);<br />
            smtp.DeliveryMethod = SmtpDeliveryMethod.Network;<br />
            try<br />
            {<br />
                smtp.Send(message);<br />
<br />
                MessageBox.Show("Success!", "Sample", MessageBoxButtons.OK, MessageBoxIcon.Information);<br />
            }<br />
            catch (Exception ex)<br />
            {<br />
                MessageBox.Show(ex.InnerException.Message);<br />
                MessageBox.Show("Failed! \r\n" + ex.Message, "Sample", MessageBoxButtons.OK, MessageBoxIcon.Warning);<br />
            }


When i am giving the invalid IP Address / port number it is giving the error "Unable to connect to Remote Server".

But when I am giving invalid user name or password it is just sending the mail.

Can any one tell me how to protect sending mail if wrong credentials are specified.

Thanks in advance.





Best Regards,
M. J. Jaya Chitra

AnswerRe: Validating the credential while sending mail Pin
Johan Martensson2-Nov-07 23:29
Johan Martensson2-Nov-07 23:29 
GeneralRe: Validating the credential while sending mail Pin
M. J. Jaya Chitra2-Nov-07 23:37
M. J. Jaya Chitra2-Nov-07 23:37 
GeneralRe: Validating the credential while sending mail Pin
Johan Martensson4-Nov-07 3:11
Johan Martensson4-Nov-07 3:11 
QuestionTAPI , H323 Pin
sima_m2-Nov-07 18:59
sima_m2-Nov-07 18:59 
QuestionTAPI , H323 Pin
sima_m2-Nov-07 18:58
sima_m2-Nov-07 18:58 
QuestionReading and writing DataSets Pin
MAW302-Nov-07 15:59
MAW302-Nov-07 15:59 
GeneralRe: Reading and writing DataSets Pin
T.EDY2-Nov-07 18:11
T.EDY2-Nov-07 18:11 
GeneralRe: Reading and writing DataSets Pin
I Believe In GOD3-Nov-07 4:13
I Believe In GOD3-Nov-07 4:13 
GeneralRe: Reading and writing DataSets Pin
MAW305-Nov-07 12:17
MAW305-Nov-07 12:17 
GeneralRe: Reading and writing DataSets Pin
MAW305-Nov-07 12:18
MAW305-Nov-07 12:18 
QuestionWrite direct to screen in game (fullscreen)??? Pin
dirwir2-Nov-07 14:29
dirwir2-Nov-07 14:29 
AnswerRe: Write direct to screen in game (fullscreen)??? Pin
Insincere Dave2-Nov-07 17:13
Insincere Dave2-Nov-07 17:13 
GeneralRe: Write direct to screen in game (fullscreen)??? Pin
dirwir3-Nov-07 1:16
dirwir3-Nov-07 1:16 
QuestionOperator overloading Pin
amatbrewer2-Nov-07 13:32
amatbrewer2-Nov-07 13:32 
AnswerRe: Operator overloading Pin
PIEBALDconsult2-Nov-07 15:51
mvePIEBALDconsult2-Nov-07 15:51 
GeneralRe: Operator overloading Pin
amatbrewer5-Nov-07 8:56
amatbrewer5-Nov-07 8:56 
AnswerRe: Operator overloading Pin
Daniel Grunwald3-Nov-07 6:08
Daniel Grunwald3-Nov-07 6:08 

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.