accept an email id & validate it .email id should not exceed
25 characters the mail id should contain 3 characters
excluding domain name,@ and .(dot) the last 3 characters
of the domain should be net,com or org

Answers were Sorted based on User's Feedback



accept an email id & validate it .email id should not exceed 25 characters the mail id should ..

Answer / mudaseer

vmail=inputbox("enter the value")
vstr=right(vmail,3)
if len(vmail)>25 then
msgbox "length is too high"
elseif instr(vmail,"@")=0 or instr(vmail,".")=0 then
msgbox "invalid-@ or . is absent"
elseif (instr(vmail,"@")-1)<3 then
msgbox "invalid-length to less"
elseif not(vstr="org" or vstr="com" or vstr="net") then
msgbox "invalid-domain not correct"
else msgbox "valid"
end if

Is This Answer Correct ?    2 Yes 1 No

accept an email id & validate it .email id should not exceed 25 characters the mail id should ..

Answer / pankaj jaju

Function IsValidEmail(strEmail)
If Len(strEmail) > 25 Then
IsValidEmail = "Email contains > 25 characters"
ElseIf LCase(Right(strEmail, 4)) <> ".net" AND LCase
(Right(strEmail, 4)) <> ".com" AND LCase(Right(strEmail,
4)) <> ".org" Then
IsValidEmail = "Email contains invalid
domain name. Use only .com or .net or .org domains only"
ElseIf UBound(Split(strEmail,"@")) > 1 Then
IsValidEmail = "@ character is used
multiple time"
ElseIf UBound(Split(strEmail,"@")) < 1 Then
IsValidEmail = "@ character is missing"
Else
IsValidEmail = True
End If
End Function

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More VB Script Interview Questions

Write program for identifyig duplicates in flight Departing from and Arriving in mercury tours(web application).

0 Answers  


write a vb-script code to delete all the mails in my gmail in the year 2011

1 Answers  


write a vb script to display calculator using case statement?

1 Answers  


Explain different types of segment?

0 Answers  


about vb scripting programs this type of all question& answers

0 Answers  






What is purpose of scripting.filesystemobject class in vbscript?

0 Answers  


Mention what is select case statement?

0 Answers  


write a program to display the system specifications of client system with the help of vbScript.

0 Answers  


while using Keyward driven framework in QTPif new requirements are added how to manage it...plz ans

0 Answers   IBM,


Can any one provide code for Mid(string,start[,length]). I have been asked to write code for Mid(). i.e We need to define our own function say MyMid() which should behave same like built-in Mid function

0 Answers   Microsoft,


write a vbscript for traffic signal

1 Answers  


Which in-built function is used to format the number in the vbscript language?

0 Answers  


Categories