email validation

Author Message
blueye89

  • Total Posts : 2
  • Scores: 0
  • Reward points : 0
  • Joined: 2/5/2012
  • Status: offline
email validation Sunday, February 05, 2012 3:48 PM (permalink)
0
Hi,I have a question for anyone who knows to resolve.
I making an "sign in" application for checking email address with username and password as input.As output it will show me msgbox with content "Your email and password are correct!" or Not.
Problem is at the end of the code,please try to help me.
There is a 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
 'Declare variables
 Dim sSelectedSMTPServer As String = ""
 Dim iSelectedSMTPPort As Integer
 
 'Check wich email account is selected and provide correct smtp address / port.
 Select Case True
 Case CheckBox1.Checked
 sSelectedSMTPServer = "smtp.gmail.com"
 iSelectedSMTPPort = 587
 Case CheckBox2.Checked
 sSelectedSMTPServer = "smtp.live.com"
 iSelectedSMTPPort = 587
 Case CheckBox3.Checked
 sSelectedSMTPServer = "smtp.mail.yahoo.com"
 iSelectedSMTPPort = 465
 Case Else
 'If no account is selected you will get a message and the program will not attempt to send the email.
 MsgBox("Please choose your email service.", vbInformation)
 End Select
 'For multiple selection
 If CheckBox1.Checked And CheckBox2.Checked Then
 MsgBox("You must select only one email service.", vbInformation)
 ElseIf CheckBox1.Checked And CheckBox3.Checked Then
 MsgBox("You must select only one email service.", vbInformation)
 ElseIf CheckBox2.Checked And CheckBox3.Checked Then
 MsgBox("You must select only one email service.", vbInformation)
 ElseIf CheckBox1.Checked And CheckBox2.Checked And CheckBox3.Checked Then
 MsgBox("You must select only one email service.", vbInformation)
 End If
 
 Exit Sub
 
 Dim SMTP As New SmtpClient
 'SSL enabled for outgoing mail.
 SMTP.EnableSsl = True
 'Get login credentials.
 SMTP.Credentials = New System.Net.NetworkCredential(TextBox1.Text, TextBox2.Text)
 'SMTP Port that will be used.
 SMTP.Port = iSelectedSMTPPort
 
 Try
 What???
 MsgBox("Successfully logged", MsgBoxStyle.Information, "Report")
 Me.Close()
 Catch ex As Exception
 MsgBox("Unsuccessfully logged", MsgBoxStyle.Exclamation, "Report")
 End Try
 End Sub
 

 
#1
    59cobalt

    • Total Posts : 981
    • Scores: 91
    • Reward points : 0
    • Joined: 7/17/2011
    • Status: offline
    Re:email validation Monday, February 06, 2012 1:57 AM (permalink)
    0
    As written in the forum description this forum is for completed (working) VBScript code only. Your code is neither working, nor VBScript, so what made you think this would be the right place to post it?
     
    #2

      Online Bookmarks Sharing: Share/Bookmark

      Jump to:

      Current active users

      There are 0 members and 1 guests.

      Icon Legend and Permission

      • New Messages
      • No New Messages
      • Hot Topic w/ New Messages
      • Hot Topic w/o New Messages
      • Locked w/ New Messages
      • Locked w/o New Messages
      • Read Message
      • Post New Thread
      • Reply to message
      • Post New Poll
      • Submit Vote
      • Post reward post
      • Delete my own posts
      • Delete my own threads
      • Rate post

      2000-2012 ASPPlayground.NET Forum Version 3.9