Connecting Tech Pros Worldwide Forums | Help | Site Map

sending Email using .net with proxy in desktop application

Newbie
 
Join Date: Nov 2008
Posts: 2
#1: Nov 12 '08
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]

Reply