Send email from QTP
Question ID: 104294
1
0

Does anyone know of a way to send an email from QTP, either directly or through QC, without installing anything additional?

Marked as spam
Posted by (Questions: 17, Answers: 807)
Asked on December 3, 2010 9:36 pm
92 views
Answers (3)
2
Private answer

use QC API, pass appropriate parameters..

Set QCConnection = CreateObject(''TDApiOle80.TDConnection'')
QCConnection.InitConnectionEx QCServer
QCConnection.login CONST_QC_LoginName, CONST_QC_Password
QCConnection.Connect CONST_QC_Domain, CONST_QC_Project
Set ConnectToQC = QCConnection
then use sendemail method...

QCConnection.SendMail ''yourmailsid@mycompany.com''

Marked as spam
Posted by (Questions: 0, Answers: 2)
Answered on December 10, 2010 4:11 pm
0
Sorry for the delay in responding on this, I've been on vacation. Gonna check this out today and will let you know how it goes.
( at January 3, 2011 2:59 pm)
1
Private answer

Try using this function:

'=================================================================
' Function SendCDOMessage
'=================================================================
' Description:
'   Sends an email message using Microsoft's CDO.Message object
' Parameters:
'   
' Return value:
'   True if succeeded, False otherwise
Public Function SendCDOMessage(EmailTo, EmailFrom, EmailSubject, MessageBody)
    Set oMessage = CreateObject(''CDO.Message'')
    ' Set message details
    oMessage.Subject = EmailSubject
    oMessage.Sender = EmailFrom
    oMessage.From = EmailFrom
    oMessage.To = EmailTo
    oMessage.AutoGenerateTextBody = True
    oMessage.HTMLBody = MessageBody
    ' Set configuration
    oMessage.Configuration.Fields(''http://schemas.microsoft.com/cdo/configuration/smtpserver'') =  ''YOUR_SMTP_SERVER_ADDRESS''
    oMessage.Configuration.Fields(''http://schemas.microsoft.com/cdo/configuration/sendusing'') = 2
    oMessage.Configuration.Fields.Update
    ' Send the message
    oMessage.Send
    If Err.Number <> 0 Then
        SendCDOMessage = False
    Else
        SendCDOMessage = True
    End If
    Set oMessage = Nothing
End Function
'=================================================================
Marked as spam
Posted by (Questions: 0, Answers: 4)
Answered on January 6, 2011 4:44 am
1
Private answer

If you have outlook on your machine you can access its object from QTP and send mails

Marked as spam
Posted by (Questions: 0, Answers: 7)
Answered on December 3, 2010 11:35 pm
0
We do not have Outlook on the machines.
( at December 7, 2010 1:45 pm)
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top