By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,561 Members | 3,221 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,561 IT Pros & Developers. It's quick & easy.

sending Email using .net with proxy in desktop application

P: 2
I am using below code for sending Email using .net.

Its not working on client machine. My server IP is:- 192.168.10.10 and also uses proxy and user-name and password for proxy settings are user-name:- user and password:-user.

Where I have to specify this proxy settings in my below code.
Expand|Select|Wrap|Line Numbers
  1.  Dim message As New MailMessage()
  2.                        message.From = New MailAddress(txtFrom.Text.Trim())
  3.  
  4.          message.To.Add(New MailAddress("trivedimca@yahoo.co.in"))
  5.                      message.Body = txtMessage.Text
  6.  
  7.             message.Subject = txtSubject.Text.Trim()
  8.  
  9.            message.Body = txtMessage.Text 
  10.  
  11.             message.IsBodyHtml = True
  12.  
  13.  
  14.             If txtServer.Text.Trim() = "" Then
  15.                 MessageBox.Show("PLEASE ENTER SERVER NAME OR SERVER IP")
  16.                 Exit Sub
  17.             Else
  18.                 Dim client As New SmtpClient(txtServer.Text.Trim())
  19.                             client.Send(message)
  20.             End If
  21.  
  22.            MessageBox.Show("MAIL SENT SUCCESSFULLY")
  23.  
  24.  
Select Tags... SaveCancel


[Edit Tags]
Nov 12 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.