sbrady Posted September 26, 2012 Share Posted September 26, 2012 how do you set up an email in OUTLOOK, subject, content, recipients Link to comment Share on other sites More sharing options...
water Posted September 26, 2012 Share Posted September 26, 2012 (edited) Please have a look at my OutlookEX UDF. Function _OL_Wrapper_SendMail does all you need. For download please see my signature. Edited September 26, 2012 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
sbrady Posted September 26, 2012 Author Share Posted September 26, 2012 cant find your signature?? *&^%$#@ Link to comment Share on other sites More sharing options...
water Posted September 26, 2012 Share Posted September 26, 2012 My signature is the lower part of my post starting with "UDFs:" My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
sbrady Posted September 26, 2012 Author Share Posted September 26, 2012 ding ding ding ding........we have a winner......thanks. Link to comment Share on other sites More sharing options...
water Posted September 26, 2012 Share Posted September 26, 2012 Great If you need to add more properties to the mail than _OL_Wrapper_SendMail accepts as parameters you need to call all functions yourself which have been wrapped by _OL_Wrapper_SendMail. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
sbrady Posted September 26, 2012 Author Share Posted September 26, 2012 My signature is the lower part of my post starting with "UDFs:"got 'em.......the whole thing is commented out, how do I know what line to take off those ";" characters.........thanks Link to comment Share on other sites More sharing options...
water Posted September 26, 2012 Share Posted September 26, 2012 What do you mean by the "the whole thing is commented out"? Can you post the relevant part of the code you talk about? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
sbrady Posted September 26, 2012 Author Share Posted September 26, 2012 am I wrong........there is a semi-colon at the start of EVERY LINE but 1. doesnt that make that line a comment , not functional code Link to comment Share on other sites More sharing options...
water Posted September 26, 2012 Share Posted September 26, 2012 You don't have to include the OutlookEX UDF you downloaded from my signature into your script. Save it in the same folder where your script is. Check the _OL_Wrapper_SendMail.au3 example script how to use the _OL_Wrapper_SendMail function to send a mail. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
BrewManNH Posted September 26, 2012 Share Posted September 26, 2012 BTW, the part you have posted is the header of the actual function, not the function itself. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
sbrady Posted September 26, 2012 Author Share Posted September 26, 2012 I am so confused........... Link to comment Share on other sites More sharing options...
water Posted September 26, 2012 Share Posted September 26, 2012 What exactly confuses you? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Colyn1337 Posted September 26, 2012 Share Posted September 26, 2012 I am so confused........... Honestly, you'll have an easier time doing what you want with COM... here's how... $objOutlook = ObjCreate("Outlook.Application") $OutlookMailItem = $objOutlook.CreateItem($olMailItem) ; $OutlookMailItem.To = "" $OutlookMailItem.Subject = "Script!" $OutlookMailItem.HTMLBody = ("say whatever you want here to appear in the body.") ;$OutlookMailItem.Attachments.Add(whateverfile here) $OutlookMailItem.Display there's a lot more you can do, but this will get you started Link to comment Share on other sites More sharing options...
water Posted September 26, 2012 Share Posted September 26, 2012 Colyn1337, please have a look at the OutlookEX we are talking about in this thread and you will see that it exactly does it this way... My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
sbrady Posted September 26, 2012 Author Share Posted September 26, 2012 colyn.........didnt work. Is there a way to create an email in OUTLOOK with AutoIT......I'm beginning to wonder. Link to comment Share on other sites More sharing options...
sbrady Posted September 26, 2012 Author Share Posted September 26, 2012 here is the Applescript waytell application "Mail"set bodyvar to "put body text here" as international text -- this is the body of the emailset recipientName to "Michael Jackson" as international textset recipientAddress to "michael.jackson@gmail.com"set subjectvar to "subject" as international text -- this is the subject linemake new outgoing messageset new_mssg to the resultset sender of new_mssg to "Michael Jackson <michael.jackson@gmail.com>"set subject of new_mssg to subjectvarset content of new_mssg to bodyvartell new_mssg to make new to recipient at end of to recipients with properties {name:recipientName, address:recipientAddress}set visible of new_mssg to trueend tell Link to comment Share on other sites More sharing options...
water Posted September 26, 2012 Share Posted September 26, 2012 With my OutlookEX UDF it's quite simple: #include <OutlookEX.au3> Global $oOutlook = _OL_Open() Global $bodyvar = "put body text here" Global $recipientAddress = "michael.jackson@gmail.com" Global $subjectvar = "subject" _OL_Wrapper_SendMail($oOutlook, $recipientAddress, "", "", $subjectvar, $bodyvar) If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OutlookSendMail Wrapper Script", "Error sending mail. @error = " & @error & ", @extended: " & @extended) MsgBox(64, "OutlookEX UDF: _OutlookSendMail Wrapper Script", "Mail successfully sent to '" & $recipientAddress & "'!") My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Colyn1337 Posted September 26, 2012 Share Posted September 26, 2012 (edited) colyn.........didnt work. Is there a way to create an email in OUTLOOK with AutoIT......I'm beginning to wonder. my bad, one small error in the code I gave you... You have to declare the $olMailItem before running the script, and it's value must be 0 so....... full code Local $olMailItem = 0 $objOutlook = ObjCreate("Outlook.Application") $OutlookMailItem = $objOutlook.CreateItem($olMailItem) ; $OutlookMailItem.To = "" $OutlookMailItem.Subject = "Script!" $OutlookMailItem.HTMLBody = ("say whatever you want here to appear in the body.") ;$OutlookMailItem.Attachments.Add(whateverfile here) $OutlookMailItem.Display Exit Edited September 26, 2012 by Colyn1337 AGlassman 1 Link to comment Share on other sites More sharing options...
sbrady Posted September 26, 2012 Author Share Posted September 26, 2012 colyn........still not working. I would expect to see Outlook become the front app, the email window pop to the front..............but nothing happens. Link to comment Share on other sites More sharing options...
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