Code: Select all
String_To := ""
String_CC := ""
String_Subject = ""
String_HTMLBody :=
(
"Hello,<br>
in <b>this</b> mail.<br><br>
<i>bye bye<br>Luigi</i>"
)
Attachment_1 := "C:\...\...\...\....ahk"
IfWinNotExist, ahk_class rctrl_renwnd32
{
MsgBox ,4 , ATTENTION, OUTLOOK must to be open.`nYou want to open Outlook now?
IfMsgBox Yes
Run C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Office\Microsoft Outlook 2010 ;your Outlook program
else
return
Return
}
IfWinExist, ahk_class rctrl_renwnd32
{
olMailItem := 0
MailItem := ComObjActive("Outlook.Application").CreateItem(olMailItem)
MailItem.SendUsingAccount := ;must investigate
MailItem.TO := String_To
MailItem.CC := String_CC
MailItem.Subject := String_Subject
MailItem.htmlbody := String_HTMLBody ; &.htmlbody
MailItem.Attachments.Add(Attachment_1) ; Attachment_1 must be set
MailItem.Display
Sleep 200
olMailItem :=
Return