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.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
    End Sub

Thank you in advance for help.

Here is also a printscreen of error.

Found as solution. SSL line is no need ti.

SMTP.EnableSsl = True

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.