Sign in to follow this  
Followers 0
sbrady

create email in OUTLOOK

23 posts in this topic

how do you set up an email in OUTLOOK, subject, content, recipients

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Please have a look at my OutlookEX UDF. Function _OL_Wrapper_SendMail does all you need.

For download please see my signature.

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

cant find your signature?? *&^%$#@

Share this post


Link to post
Share on other sites

My signature is the lower part of my post starting with "UDFs:"


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

ding ding ding ding........we have a winner......thanks.

Share this post


Link to post
Share on other sites

Great :D

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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 codePosted Image

Share this post


Link to post
Share on other sites

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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 Gude
How 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

Share this post


Link to post
Share on other sites

I am so confused...........

Share this post


Link to post
Share on other sites

What exactly confuses you?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

colyn.........didnt work. Is there a way to create an email in OUTLOOK with AutoIT......I'm beginning to wonder.

Share this post


Link to post
Share on other sites

here is the Applescript way

tell application "Mail"

set bodyvar to "put body text here" as international text -- this is the body of the email

set recipientName to "Michael Jackson" as international text

set recipientAddress to "michael.jackson@gmail.com"

set subjectvar to "subject" as international text -- this is the subject line

make new outgoing message

set new_mssg to the result

set sender of new_mssg to "Michael Jackson <michael.jackson@gmail.com>"

set subject of new_mssg to subjectvar

set content of new_mssg to bodyvar

tell new_mssg to make new to recipient at end of to recipients with properties {name:recipientName, address:recipientAddress}

set visible of new_mssg to true

end tell

Share this post


Link to post
Share on other sites

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#19 ·  Posted (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 by Colyn1337

Share this post


Link to post
Share on other sites

colyn........still not working. I would expect to see Outlook become the front app, the email window pop to the front..............but nothing happens.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0