Dim ToEmail, Tomail_Value, CountRecipients
CountRecipients = oMessage.Recipients.Count
For i = 0 to CountRecipients
ToEmail = Split( (oMessage.Recipients(i).Address) , "@" )
ToEmail_Value = ToEmail(1)
If LCase (ToEmail_Value)<>LCase("IBM.cn") then
Result.Value = 2
Result.Message = "Does NOT Allow To Send External Messages. Address is "+ oMessage.Recipients(i).Address +"."
Set FSO2 = CreateObject("Scripting.FileSystemObject")
Set str = FSO2.OpenTextFile("C:\Program Files\hMailServer\Logs\LimitUsers.log",8,True)
strResponses = str.Writeline(CStr(Now)+"–>"+oClient.UserName+"–>"+oMessage.Recipients(i).Address)
str.Close
Exit For
End If
Next