Login   /   Register

Sending mail without a security popup

Rate this article
     2 votes, average: 4 out of 52 votes, average: 4 out of 52 votes, average: 4 out of 52 votes, average: 4 out of 52 votes, average: 4 out of 5
Loading ... Loading ...
June 4th, 2008 by Yaron Assa

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

One Response to “Sending mail without a security popup”

  1. umang_agl Says:

    [+]

    The message could not be sent to the SMTP server. The transport error code was 0x80070057. The server response was not available ... ...

Leave a Reply

You must be logged in to post a comment.

This article was viewed 734 times