08-14-2008, 03:25 PM
Hi,
The code for sending mail through qtp is in this function..is workign for me when i execution the function in QTP but when i open .vbs file it trhows syntax error..
The code for sending mail through qtp is in this function..is workign for me when i execution the function in QTP but when i open .vbs file it trhows syntax error..
Code:
Public Function SendMail(SendTo,SendCC,Subject,Body,Attachment)
Dim olApp
Dim olNs
Dim olMail
Set olApp = GetObject(, "Outlook.Application")
On Error GoTo 0
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.To = SendTo
.CC = SendCC
.Subject = Subject
.Body = Body
.Attachments.Add(Attachment)
.Display
.Send
End With
Set olMail = Nothing
Set olApp = Nothing
End Function