Tech Off Thread

2 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Problem sending an email.

Back to Forum: Tech Off
  • User profile image
    peoples

    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"
            Mail.To.Add("username@yahoo.co.uk")
            Mail.From = New MailAddress("username@yahoo.co.uk")
            Mail.Body = "Test Body"
    
            Dim SMTP As New SmtpClient("smtp.mail.yahoo.co.uk")
    
            SMTP.EnableSsl = True
            SMTP.Credentials = New System.Net.NetworkCredential("username", "password")
            SMTP.Port = "110"
            SMTP.Send(Mail)
    
    
    
        End Sub

    Can anyone see where I am going wrong ? It just comes up with an error, fail to send.

     

    ~Thanks~

     

  • User profile image
    peoples

    Sorry got it working, I had the wrong port. Thanks anyway.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.