7
Contributors
8
Replies
19
Views
7 Years
Discussion Span
Last Post by bru moses
0

I am a c# programmer I give some idea

01)get text box value to the string & split it to separate email address using split() function in string class
via spaces
eg-> iamchamith@yahoo.com [space] iamkasun@yahoo.com
arr[0] = iamchamith@yahoo.com
arr[1] = imakasun@yahoo.com

02)then get this values[each email addresses] to the array

03)now u can validate is each array(email address) correct using this method

04)In that case you check index of @ mark & . mark ...

05)Now You can validate it
[id index of @ small than index of . the email is correct]

Thanks

0

Yes you can follow the steps that iamchamith said. After getting individaul email then you can validate those from the following URL:

http://shawpnendu.blogspot.com/2009/04/cross-browser-javascript-aspnetc-email.html

This will just check the input format. If you are looking to test that email id really exist or not then you can try with VRFY(most mail server admin disables this feature for spammers) function of SMTP. For more details read rfc of SMTP.

Edited by mail2saion: n/a

0

Try string.Split should work. If you want validate you can write a regex for the same. Thanks.

0
Private Function ValidateEmail(ByVal EmailAddress As String) As Boolean
        Try
            If EmailAddress.Trim.Length = 0 Then
                MsgBox("Please enter the email Address")
                Return False
            End If
            Dim pattern As String = "^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$"

            Dim emailAddressMatch As Match = Regex.Match(EmailAddress, pattern)
            If emailAddressMatch.Success Then
                Return True
            Else
                MsgBox("Please enter the valid email address")
                Return False
            End If


        Catch ex As Exception

        End Try
    End Function

Pass each email adress from array to this function and it will return true or false

0

The question was he wants to read emails from multiline text box and not the email validation i think

0
 <asp:RequiredFieldValidator ID="rfvEmailId" runat="server" 
                    ErrorMessage="Enter your city" ControlToValidate="txtEmailId" 
                    Display="Dynamic" ValidationGroup="RegisterButton" >*</asp:RequiredFieldValidator>
                         <asp:RegularExpressionValidator ID="revEmail" runat="server" 
                             ControlToValidate="txtEmailId" ErrorMessage="Invalid Email Id" 
                             ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" 
                             ValidationGroup="RegisterButton"></asp:RegularExpressionValidator>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.