3mustgetbeers Posted July 10, 2011 Posted July 10, 2011 Hi, I am writing a funtion for a button that emails a printscreen and have got a bit stuck. I am using both #include <INet.au3> and #include <ScreenCapture.au3> to accomplish this. So far I have this: #include <INet.au3> #include <ScreenCapture.au3> Local $EmailAddress = "x@y.z" Local $PRTSCR_image WinActivate( "Panel") $PRTSCR_image = _ScreenCapture_Capture ("") $Address = $EmailAddress $Subject = "Screenshot from (USERNAME: " & @UserName & ") working on (HOSTNAME: " & @ComputerName & ")" $Body = $PRTSCR_image _INetMail($address, $subject, $body) OK, this works except for pasting the printscreen into the body of the email. The new message appears, correct 'To:' address, correct subject but the body of the email contains 0x9E050A9A - or similar hex string. I guess this is some sort of win handle?? What I ideally want is the screenshot 'pasted' into the body. That and for the email to just be sent. Thanks for any ideas!
somdcomputerguy Posted July 10, 2011 Posted July 10, 2011 See the Remarks, _ScreenCapture_Capture. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
3mustgetbeers Posted July 10, 2011 Author Posted July 10, 2011 (edited) Cheers somdcomputerguy - quite embarrassing that I didn't check the help file though! Cracked it now though Dumped the _INETMAIL - didn't appear suited to what I wanted on this occasion - substituted for OutlookEX.au3 ; Take screen shot & save Local $TLSprtscr_image WinActivate("Panel") Local $TLSprtscr_image = _ScreenCapture_Capture ("C:\ISSD_PRTSCR.jpg") Local $oOutlook = _OL_Open() _OL_Wrapper_SendMail($oOutlook, _ ; mail client $SD_EmailAddress, _ ; TO: "", _ ; CC: "", _ ; BCC: "Screenshot from (USERNAME: " & @UserName & ") working on (HOSTNAME: " & @ComputerName & ")", _ ;Subject "Hi.<br><br>Please find a screen shot of my error attached.<br><br>Thanks,<br><br>" & @UserName, _ ; Body "C:\ISSD_PRTSCR.jpg", _ ; Attachment $olFormatHTML, "") _ ; format If @error <> 0 Then Exit MsgBox(16, "ERROR", "Error sending mail." & @CRLF & "Please try again." & @CRLF & "If problem persists, please complete task manually") MsgBox(64, "Complete", "Screenshot succussfully sent to '" & $SD_EmailAddress & "'." & @CRLF &"NOTE: This will show in your sent items.") FileDelete("C:\ISSD_PRTSCR.jpg") Cheers! Edited July 10, 2011 by 3mustgetbeers
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now