hi Amit,
Below is the script and now i am getting different type of error.
*Set* oMessage = *CreateObject*("CDO.Message")
oMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
*'SMTP Server*
oMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="
nasa2smtp.mmc.com"
oMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
oMessage.Configuration.Fields.Update
oMessage.Subject = "Test"
oMessage.Sender = "[email protected] <[email protected]>" *'any
non-existing mail id will also work.*
oMessage.*To* = "[email protected] <[email protected]>"
*'oMessage.CC = "[email protected] <[email protected]>"*
*'oMessage.BCC = ""*
oMessage.AddAttachment "C:\Sanity_Automation1\Result\Result.xls"
oMessage.TextBody = "Hi" & *vbcrLf* & *vbCrlf* & "PFA the Smoke Test
Automation Results" & *vbCrlf* & *vbCrlf* & "Thanks" & *vbcrlf* & "Tanvi
Malik"
oMessage.Send
*Set* oMessage = *Nothing*
*Regards,Tanvi Malik*
On Mon, May 11, 2015 at 12:59 PM, amit rathi <[email protected]> wrote:
> Hi tanu,
> script can be like that.
>
> Sub SendMail (strTextBody)
> Set objEmail = CreateObject("CDO.Message")
> objEmail.From = "[email protected]"
> objEmail.To = "[email protected]"
> objEmail.Subject = "UFT Regression Test results for IE10 "
> objEmail.Textbody = strTextBody
> objEmail.Configuration.Fields.Item ("
> http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
> objEmail.Configuration.Fields.Item ("
> http://schemas.microsoft.com/cdo/configuration/smtpserver") = "
> smtp.xxxxx.com"
> objEmail.Configuration.Fields.Item ("
> http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
> objEmail.Configuration.Fields.Update
> objEmail.Send
> End Sub
>
> Thanks
> Amit Rathi
>
> On Fri, May 8, 2015 at 12:37 PM, Tanu Malik <[email protected]>
> wrote:
>
>> hi Dmitry ,
>>
>> Can you please send me the script on how can i send emails in outlook
>> through QTP. Actually i am using UFT, windows7, so can you please let me
>> know how can i auto tiigger the autiomation script.
>> Appreciate your help.
>>
>>
>> On Thursday, 2 November 2006 17:25:47 UTC+5:30, Dmitry Motevich wrote:
>>
>>> I think, my answer will help you...
>>>
>>> I created several scheduled tasks - they send special messages to some
>>> sites (it's a not a spam :) ).
>>>
>>> Let's see the one scheduled tasks.
>>> It runs every 3 days the file:
>>> "D:\Program Files\Mercury Interactive\QuickTest
>>> Professional\Tests\AllenCarr\aldebaran_ru\_bat\start_test.cmd"
>>>
>>> This cmd-file contains:
>>> echo ========================================== >> test_results.txt
>>> date /T >> test_results.txt
>>> time /T >> test_results.txt
>>>
>>> cscript //nologo .\test.vbs >> test_results.txt 2>&1
>>>
>>> Next, file test.vbs contains:
>>> Dim qtApp 'As QuickTest.Application ' Declare the Application object
>>> variable
>>> Dim qtTest 'As QuickTest.Test ' Declare a Test object variable
>>> Dim qtResultsOpt 'As QuickTest.RunResultsOptions ' Declare a Run Results
>>> Options object variable
>>>
>>> Set qtApp = CreateObject("QuickTest.Application") ' Create the
>>> Application object
>>> qtApp.Launch ' Start QuickTest
>>> qtApp.Visible = True ' Make the QuickTest application visible
>>>
>>> qtApp.Open "D:\Program Files\Mercury Interactive\QuickTest
>>> Professional\Tests\AllenCarr\aldebaran_ru", True ' Open the test in
>>> read-only mode
>>>
>>> ' set run settings for the test
>>> Set qtTest = qtApp.Test
>>> qtTest.Run
>>>
>>> WScript.StdOut.Write "Test status: " + qtTest.LastRunResults.Status +
>>> vbCr ' Check the results of the test run
>>>
>>> qtTest.Close ' Close the test
>>>
>>> qtApp.Quit ' Close the QTP'
>>>
>>> And, last note... "D:\Program Files\Mercury Interactive\QuickTest
>>> Professional\Tests\AllenCarr\aldebaran_ru" is my script which sends
>>> special messages to site.
>>>
>>> That's all.
>>> So, what I have is the following... Every 3 days scheduler executes this
>>> script. Result of test execution is written to file ("test_results.txt" in
>>> this case).
>>> Pay attention, I use file logging for results ( WScript.StdOut.Write
>>> "Test status: " + qtTest.LastRunResults.Status + vbCr). But you can
>>> send messages via Win-messenger service or send emails (I can provide such
>>> scripts for additional reward :) ).
>>> If you have some questions, please feel free to contact me if you need.
>>> I will answer...
>>>
>>> --
>>> Dmitry Motevich
>>>
>>>
>>>
>>> On 11/2/06, Dmitry Motevich <[email protected]> wrote:
>>>>
>>>>
>>>> I need to run QTP tests without a human in the loop - that is
>>>> automatically and unattended. If QTP needs to be driven by an external
>>>> script (shell, Perl, Windows's CScript,...) that's fine.
>>>>
>>>> The requirement is that I can issue a single command ( or have a
>>>> scheduler do it) and walk away. When I come back, I want to see if all
>>>> the tests passed or if any failed (thumbs up/thumbs down).
>>>>
>>>> I've seen mention of a unsupported tool from the QTP folks that does
>>>> this but I've not been able to find it (One chap I found who had it
>>>> doesn't have it any more.)
>>>>
>>>> I'd appreaciate any help or pointers you might have.
>>>>
>>>>
>>>>
>>> --
>> --
>> You received this message because you are subscribed to the Google
>> "QTP - HP Quick Test Professional - Automated Software Testing"
>> group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group at
>> http://groups.google.com/group/MercuryQTP?hl=en
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "QTP - HP Quick Test Professional - Automated Software Testing" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
---
You received this message because you are subscribed to the Google Groups "QTP
- HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.