Page 1 of 1

send mail via Outlook

Posted: 25 Sep 2016, 06:24
by Tomer
Hii,

I would like to send mail with ahk, I have this script which opens a new window message in outlook and then I just have to click "Send",
is it possible to send it automatically as well ?

Thanks!

Code: Select all

MailList := "[email protected]; [email protected]"

;edited out content

GoTo, EmailThem
Return

EmailThem:
Run, mailto:%MailList%?subject=Scheduled Database Maintenance&body=Greetings.`%0A`%0AWe are currently attempting to update or manage the MetroE 'Commercial Survey Tracker' database and noticed that you may still be logged in.`%0A`%0APlease save any updates or changes you have made and exit the database as soon as possible.  Maintenance should only last a few minutes once everyone is out.`%0A`%0AIf you have already logged out`, please disregard this automated system message.`%0A`%0A`%0A`%0AThank You.
Return

Re: send mail via Outlook

Posted: 25 Sep 2016, 13:58
by BuLLDoG
Yea, with ComObject :)

Re: send mail via Outlook

Posted: 27 Sep 2016, 02:11
by Tomer
@BuLLDoG

tnx

Re: send mail via Outlook

Posted: 27 Sep 2016, 15:05
by BuLLDoG

Code: Select all

MailItem := ComObjCreate("Outlook.Application").CreateItem(0)
MailItem.Recipients.Add("[email protected]")
MailItem.attachments.add("c:\test.pdf")
MailItem.Subject := "Hello World"
MailItem.body := "Hello body text"
MailItem.display

Re: send mail via Outlook

Posted: 27 Sep 2016, 15:07
by BuLLDoG
MailItem.send
:)

Re: send mail via Outlook

Posted: 27 Sep 2016, 15:19
by BuLLDoG
It's only a sample with the options you may need.

Re: send mail via Outlook

Posted: 04 Oct 2016, 12:41
by Tomer
Tnx!