Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
send report via email
#9
Solved: 10 Years, 10 Months, 1 Week ago
'Email generation VB Script snipet.
'Pre requisite: MS Outlook apllication up running on the desktop

Code:
Dim ToAddress
Dim Subject
Dim Body
Dim Attachment
Dim oUtlookApp, nAmeSpace, newMail

'SystemUtil.Run "C:\Program Files\Microsoft Office\Office11\OUTLOOK.EXE" 'This line should be enabled if the Outlook on the desktop is not running

SystemUtil.Run "C:\Program Files\Outlook Express\msimn.exe"

ToAddress = "xyz@gmail.com" ' Message recipient Address

Set oUtlookApp = CreateObject("Outlook.Application")

Set nAmeSpace = oUtlookApp.GetNamespace("MAPI")

Set newMail = oUtlookApp.CreateItem(0)

Subject = "This is a test mail" 'Message Subject you can update

Body = "This the message for testing. " 'Message body you can update

newMail.Subject = Subject

newMail.Body = Body & vbCrLf

newMail.Recipients.Add(ToAddress)

newMail.Attachments.Add("D:\Automation\report\login.html") 'You can update attachment file name

newMail.Send

Set nAmeSpace = Nothing

Set oUtlookApp = Nothing

'end of the email generation code===================================================================
Reply


Messages In This Thread
send report via email - by sia sharma - 07-27-2012, 04:50 PM
RE: send report via email - by ssvali - 07-27-2012, 04:57 PM
RE: send report via email - by sia sharma - 07-27-2012, 05:08 PM
RE: send report via email - by ssvali - 07-30-2012, 11:04 AM
RE: send report via email - by sia sharma - 07-30-2012, 02:36 PM
RE: send report via email - by ssvali - 07-30-2012, 03:09 PM
RE: send report via email - by sia sharma - 07-30-2012, 03:26 PM
RE: send report via email - by ssvali - 07-30-2012, 03:52 PM
RE: send report via email - by sia sharma - 07-30-2012, 04:02 PM
RE: send report via email - by ssvali - 07-30-2012, 04:14 PM
RE: send report via email - by QTPScript - 08-29-2012, 10:05 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to send/pass UFT Run Error Dialog as output value to main driver script lravi4u 0 374 11-05-2023, 03:55 PM
Last Post: lravi4u
  Send automatic email notification when test run started helmzshelmz 0 949 04-03-2020, 07:54 AM
Last Post: helmzshelmz
  Report Viewer showing hundreds of WebElement.Exists? themoon 1 2,238 03-09-2016, 02:43 PM
Last Post: vinod123
  To send Fail Results to mail Naresh 1 2,439 04-23-2015, 08:30 PM
Last Post: babu123
  How to attach HTML file to Email Naresh 0 2,778 04-06-2015, 02:04 PM
Last Post: Naresh

Forum Jump:


Users browsing this thread: 1 Guest(s)