954,514 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

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

Hello,

I'm need to create a small report to be send automaticliy from VB.NET Windows application. I have wrote below code which is workin 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.

dejanc
Newbie Poster
24 posts since Dec 2010
Reputation Points: 10
Solved Threads: 0
 

Here is also a printscreen of error.

Attachments Capture[2].png 42.76KB
dejanc
Newbie Poster
24 posts since Dec 2010
Reputation Points: 10
Solved Threads: 0
 

Found as solution. SSL line is no need ti.

SMTP.EnableSsl = True

dejanc
Newbie Poster
24 posts since Dec 2010
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: