1 Replies - 2357 Views - Last Post: 07 February 2012 - 02:42 AM Rate Topic: -----

#1 dejanc  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 29-March 11

How to send vb.net windows application email over proxy server?

Posted 06 February 2012 - 03:55 AM

Hello,

I need to create a small report to be send automaticliy from VB.NET Windows application. I have wrote below code which is working on my private PC, and with Gmail settings, such as username + password + smtp.gmail.com, etc...

But with, my work informations, like my proxy ID + proxy password + company smptserver + port 25, does not working .

Do I missing some lines in my code?

Imports System.Net.Mail

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim Mail As New MailMessage
        Mail.Subject = "test email"
        Mail.To.Add("emailaddress")
        Mail.From = New MailAddress("emailaddress")
        Mail.Body = TextBox1.Text

        Dim SMTP As New SmtpClient("smtpserver")
        SMTP.EnableSsl = True
        SMTP.Credentials = New System.Net.NetworkCredential("username", "password")
        SMTP.Port = 25
        SMTP.Send(Mail)
    End Sub




Thank you in advance for help.

Here is also printscreen of error, while try to execute program.

printscreen

Attached image(s)

  • Attached Image


Is This A Good Question/Topic? 0
  • +

Replies To: How to send vb.net windows application email over proxy server?

#2 dejanc  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 29-March 11

Re: How to send vb.net windows application email over proxy server?

Posted 07 February 2012 - 02:42 AM

Found as solution. SSL line is no need ti.

SMTP.EnableSsl = True
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1