Jump to content

cuddle

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by cuddle

  1. Oh the problem is that i am not getting the sender's email id correct.It is giving the recipients email id. Do you know how to check the sender's email id in VBscript. for recipients email id i used the following code Dim myolApp As Outlook.Application ' Dim myNamespace As Outlook.NameSpace ' Set myolApp = CreateObject("Outlook.Application") 'Set myNamespace = myolApp.GetNamespace("MAPI") How can I get Sender's email address?
  2. Hi, I am a newbie in VB and trying to write a script that gets an email from a senders,captures the senders email id and compare that email id from a text file that contain email id of all teh registered users.If senders email id is found there ,scripts allow the sender to go further else send the error messgae that you are not registered. I have done Dim myolApp As Outlook.Application Dim myNamespace As Outlook.NameSpace Set myolApp = CreateObject("Outlook.Application") Set myNamespace = myolApp.GetNamespace("MAPI") emailid = myNamespace.CurrentUser.AddressEntry 'MsgBox EmailId Sub ReadFile(sFilePathAndName) sFilePathAndName = "C:\registeresusers\Logins.txt" Dim sFileContents Set oFS = Server.CreateObject("Scripting.FileSystemObject") If oFS.FileExists(sFilePathAndName) = True Then Set oTextStream = oFS.OpenTextFile(sFilePathAndName, 1) sFileContents = oTextStream.ReadAll For Each ID In Group intCompare = StrComp(emailid, "E-mail Address", vbTextCompare) If intCompare = 0 Then MsgBox "continue" Else SendErrorEmail item, _ "You are not allowed to go further." Exit Sub End If oTextStream.Close Set oTextStream = Nothing End If Set oFS = Nothing 'ReadFile = sFileContents End Sub I dont know where I am going wrong but the script is not checking against the email addresses of each user.
×
×
  • Create New...