I’ve published a QTip regarding handling the Outlook Security Popup that shows whenever you try sending an E-Mail via scripting.
Naikaparna was kind enough to share her own code for sending E-Mails, which uses CDO, and does not initiate the security warning.
Const SMTPSERVER = “smtpservername”
Set Mail = CreateObject(”CDO.Message”)
Mail.From = From
Mail .To = SendTo
Mail .Subject = Subject
If UseHTML = True Then
Mail .HTMLBody = Body
Else
Mail .TextBody = Body
End If
‘ Define server / protocols
Mail.Configuration.Fields(”http://schemas.microsoft.com/cdo/configuration/smtpserver”) = SMTPSERVER
Mail.Configuration.Fields(”http://schemas.microsoft.com/cdo/configuration/sendusing”) = 2 ‘ cdoSendUsingPort
Mail.Configuration.Fields.Update
Mail.Send
Thanks, Naikaparna for your contribution for the QTP Community.
Posted in CDO Component, Outlook


Yaron Assa




July 25th, 2008 at 1:43 pm
The message could not be sent to the SMTP server. The transport error code was 0×80070057. The server response was not available
I got this error message when script finished execution.