Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Email from qtp to Microsoft outlook through vb script
#11
Solved: 11 Years, 4 Months, 1 Week ago
Hi ,
I am getting an error while using this code like "The "SendUsing" configuration value is invalid."


Code:
Set objMessage = CreateObject("CDO.Message")
Set objEmail=CreateObject("CDO.Message")
objMessage.Subject = "Simple plain text CDO example"
objMessage.From = "sirisha.guntur@ge.com"
objMessage.To = "sirisha.guntur@wisseninfotech.com"
objMessage.TextBody = "This is a test."
objMessage.Send
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "amermsx.med.ge.com"
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
Reply
#12
Solved: 11 Years, 4 Months, 1 Week ago
Code:
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "amermsx.med.ge.com"

This is not correct could you please check this..
I am tring for my server it is working fine.


And also you should objMessage.Send use this at the end
Reply
#13
Solved: 11 Years, 4 Months, 1 Week ago
Code:
Set objEmail=CreateObject("CDO.Message")
objEmail.Subject = "Simple plain text CDO example"
objEmail.From = "sirisha.guntur@ge.com"
objEmail.To = "sirisha.guntur@wisseninfotech.com"
objEmail.TextBody = "This is a test."

objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "amermsx.med.ge.com"
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send
Reply
#14
Solved: 11 Years, 4 Months, 1 Week ago
Hi ,
THis code is working fine .

Code:
Set objEmail = CreateObject("CDO.Message")

objEmail.From = "sirisha.guntur@wisseninfotech.com"
objEmail.To = "sirisha.guntur@ge.com"
objEmail.Subject = "Server down"
objEmail.Textbody = "Server1 is no longer accessible over the network."

objEmail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserver") =  "amermsx.med.ge.com"
objEmail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update

objEmail.Send
Reply
#15
Solved: 11 Years, 4 Months, 1 Week ago
So you got the solution good..
Have a nice day
Reply
#16
Solved: 11 Years, 4 Months, 1 Week ago
Hi Surya ,

I am not able to send a mail from qtp to outlook with the help of qc
cAN UTELL EMTHE SCRIPT
Reply
#17
Solved: 11 Years, 4 Months, 1 Week ago
First make sure you QTP is connected to QC.

Then try this below, this should work. I am currently using it.

QCUtil.QCConnection.SendMail "yourmailsid@mycompany.com"
Reply
#18
Solved: 11 Years, 4 Months, 1 Week ago
One more is your QC configured Properly to send mails? If not sure contact the concern person
Reply
#19
Solved: 11 Years, 4 Months, 1 Week ago
I have worked on some other script .

This will post the empty defect from qc to outlook.

Noe i need a script if i get a bug in qtp how to post to qc immedialtely
'Create connection
Code:
Dim QCConnection
Set QCConnection = QCUtil.QCConnection
Set BugFactory = QCConnection.BugFactory
'Add a new, empty defect
Code:
Set bug = BugFactory.AddItem (Nothing)

bug.field("BG_SUMMARY") = defect_summary '"test adding a new defect from QTP as well as automatic e-mail functionality"
bug.field ("BG_STATUS") = "New" '--Default
bug.field ("BG_DETECTED_BY") = siri
bug.field ("BG_DETECTION_DATE") = date() 'Default to current date
bug.field ("BG_DESCRIPTION") = "Requirement = '"&req&"Reporting defect of QC through mail from QTP to the USER "&defect_desc'"This is a test entry from automation, QuickTest Pro. The actual result did not meet the expected result. The Analyst, Developer (Assigned To person) and Tester (Deteted By person) should get an email of this defect automatically."
bug.field ("BG_RESPONSIBLE") = sam  '"georgeslauture" 'Assigned To field
'These are user defined fields
Code:
'bug.field ("BG_USER_02") = sam "Analyst field
'bug.field ("BG_USER_04") = "Testing" 'Introduced By field -- DEFAULT
'bug.field ("BG_USER_05") = req'Requirements field
'bug.field ("BG_USER_03") ="Automation" 'Found In field - 'Default
''install_date = DateAdd("d",30,date())
'bug.field ("BG_USER_06") = install_date 'Install Date field
bug.Post 'commit to creating defect

'Clean and and release resources
Code:
Set BugFactory = Nothing
Set bug = Nothing
Reply
#20
Solved: 11 Years, 4 Months, 1 Week ago
I didnt work on this but i think we have a setting QC which will automatically post a defect to QC.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Send automatic email notification when test run started helmzshelmz 0 1,083 04-03-2020, 07:54 AM
Last Post: helmzshelmz
  How to attach HTML file to Email Naresh 0 3,071 04-06-2015, 02:04 PM
Last Post: Naresh
  Help getting Sender Name from Email nidhitaneja 0 2,084 06-15-2014, 09:03 AM
Last Post: nidhitaneja
  Clicking a link in an outlook email using QTP kirti 0 5,627 06-15-2014, 01:25 AM
Last Post: kirti
  How do I save name and email address in QTP ? Shiv Y 1 2,504 12-19-2013, 07:24 AM
Last Post: basanth27

Forum Jump:


Users browsing this thread: 1 Guest(s)