Hi guys ,

On my emailer program ive created a messagebox to appear if any of the textboxes are empty when i clcik send, its works fine (first time) but if i leave a textbox empty for the second time and click send i get an error.

Code:
   Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        If TextBox1.Text = "" And TextBox3.Text = "" And TextBox4.Text = "" And TextBox6.Text = "" And TextBox2.Text = "" Then
            MsgBox("You Didn't Fill Up The Form Correctly, Please Check Again", MsgBoxStyle.Exclamation)
        End If

        i = 0
        strmessage = "Your e-mail has been sent !"
        Timer2.Enabled = True
        Label4.Text = ""
   

        Dim mail As New MailMessage()
        Dim SmtpServer As New SmtpClient
        SmtpServer.Credentials = New Net.NetworkCredential(TextBox1.Text, TextBox3.Text)
        SmtpServer.Port = 587
        SmtpServer.Host = "Smtp.mail.yahoo.co.uk"
        SmtpServer.EnableSsl = False
        mail.To.Add(TextBox4.Text)
        mail.From = New MailAddress(TextBox1.Text)
        mail.Subject = TextBox6.Text
        mail.Body = TextBox2.Text
        

        If Not TextBox8.Text = "" Then
            Dim attach As New Attachment(TextBox8.Text)
            mail.Attachments.Add(attach)
        End If

        SmtpServer.Send(mail)
        MsgBox("E-mail Sent Successfully - " + TextBox4.Text + "", MsgBoxStyle.Information)
        
    End Sub