Hi Ann,
I'm really sorry for troubling you with this issue...
I changed the schema settings as you said, I'm not getting any email...
After changing the schema in the below code, I'm getting "
Not Sent" in the test result, below is the code...
Sub MainTest
MainTest
If SendEmaill("anil.yadrami@in4velocity.com", "anil.yadrami@in4velocity.com", "Subject", _
"Message body", "") Then
' Message was sent
Log.Message "sent"
Else
' Message was not sent
Log.Message "not sent" 'I'm getting this message in the log test results this time
End If
End Sub
'================================================================================================
Function SendEmaill(mFrom, mTo, mSubject, mBody, mAttachment)
Err.Clear
On Error Resume Next
schema = "http://schemas.microsoft.com/cdo/configuration/"
Set mConfig = Sys.OleObject("CDO.Configuration")
mConfig.Fields.Item(schema + "sendusing") = 587 ' cdoSendUsingPort
mConfig.Fields.Item(schema + "smtpserver") = "smtp.gmail.com" ' SMTP server
mConfig.Fields.Item(schema + "smtpserverport") = 80 ' Port number
mConfig.Fields.Item(schema + "sendusername") = "anil.yadrami" ' User name (if needed)
mConfig.Fields.Item(schema + "sendpassword") = "adsf" ' User password (if needed)
mConfig.Fields.Update()
Set mMessage = Sys.OleObject("CDO.Message")
mMessage.Configuration = mConfig
mMessage.From = "anil.yadrami@in4velocity.com"
mMessage.To = "anil.yadrami@in4velocity.com"
mMessage.Subject = "Automation: Testing"
mMessage.HTMLBody = "Email Received"
aqString.ListSeparator = ","
For i = 0 To aqString.GetListLength(mAttachment) - 1
mMessage.AddAttachment aqString.GetListItem(mAttachment, i)
Next
mMessage.Send
If Err.Number > 0 Then
Log.Error "E-mail cannot be sent", Err.Description
SendEMail = False
Else
Log.Message "Message to <" + mTo + "> was successfully sent"
SendEMail = True
End If End Function