Professional Documents
Culture Documents
Intra = "Site1@org.com,Site2@org.com"
Extra = "Site1@org.com,Site2@org.com"
IntGmailID = "Site1@org.com"
GmailID = "test@gmail.com"
smtp = "BH1"
aMbxserver = "MBS1"
If uBound(eArr) < 1 then Wscript.echo "Input atleast 2 Email address for internal
mailflow test"
for i = 0 to ubound(eArr)-1
for j = i+1 to ubound(eArr)
aFrom=trim(eArr(i))
aTo = trim(eArr(j))
Sendmail = SendMailByCDO(Subject, smtp, aFrom, aTo, mode)
Wscript.echo Sendmail & VbCrlf
Wscript.echo "Sleeping for 30 Seconds" & VbCrlf
Wscript.sleep(30000)
aMbx = GetAlias(aFrom)
dMbx = GetAlias(aTo)
Checkmsg = chkmsg(Subject,aMbxserver,aMbx,Mode)
Wscript.echo Checkmsg & VbCrlf
If Mode = "Internal" then
Mode = "External"
Delmsg = chkmsg(Subject,aMbxserver,dMbx,Mode)
Else
End If
next
next
eArr = split(Extra,",")
Mode = "External"
for i = 0 to ubound(eArr)
aFrom=trim(eArr(i))
aTo = GmailID
Sendmail = SendMailByCDO(Subject, smtp, aFrom, aTo, mode)
Wscript.echo Sendmail
Wscript.sleep(120000) & VbCrlf
Wscript.echo "Sleeping for 120 Seconds" & VbCrlf
aMbx = GetAlias(IntGmailID)
aMbxserver = "usoldtms006"
'Wscript.echo aTo
'Wscript.echo dMbx
Checkmsg = chkmsg(Subject,aMbxserver,aMbx,Mode)
Wscript.echo Checkmsg & VbCrlf
'If Mode = "Internal" then
'Mode = "External"
'Delmsg = chkmsg(Subject,aMbxserver,dMbx,Mode)
'Else
'End If
next
Const cdoAnonymous = 0
Const cdoBasic = 1
Const cdoNTLM = 2
'SMTP Authentication
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")
= 2
' .Item("http://schemas.microsoft.com/cdo/configuration/sendusername")
=""
' .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") =
""
.Update
End With
'Set TextBody property If you want To send the email As plain text
.TextBody = TextBody
Dim objSession
Set objSession = CreateObject("MAPI.Session")
strProfileInfo = Server & vbLf & Mailbox
objSession.Logon "", "", False, True, 0, False, strProfileInfo
End Function
Function GetAlias(Emailadd)
If objRecordSet.RecordCount = 0 Then
GetAlias = "Emailadd"
Else
While Not objRecordSet.EOF
GetAlias = objRecordSet.Fields("mailNickName")
objRecordSet.MoveNext
Wend
End If
End Function