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.

   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.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)
        End If

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