send mail via Outlook

Ask gaming related questions (AHK v1.1 and older)
User avatar
Tomer
Posts: 366
Joined: 21 Aug 2016, 05:11

send mail via Outlook

25 Sep 2016, 06:24

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
BuLLDoG
Posts: 10
Joined: 02 Jul 2015, 16:28

Re: send mail via Outlook

25 Sep 2016, 13:58

Yea, with ComObject :)
User avatar
Tomer
Posts: 366
Joined: 21 Aug 2016, 05:11

Re: send mail via Outlook

27 Sep 2016, 02:11

@BuLLDoG

tnx
BuLLDoG
Posts: 10
Joined: 02 Jul 2015, 16:28

Re: send mail via Outlook

27 Sep 2016, 15:05

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
BuLLDoG
Posts: 10
Joined: 02 Jul 2015, 16:28

Re: send mail via Outlook

27 Sep 2016, 15:07

MailItem.send
:)
BuLLDoG
Posts: 10
Joined: 02 Jul 2015, 16:28

Re: send mail via Outlook

27 Sep 2016, 15:19

It's only a sample with the options you may need.
User avatar
Tomer
Posts: 366
Joined: 21 Aug 2016, 05:11

Re: send mail via Outlook

04 Oct 2016, 12:41

Tnx!
Zubarm
Posts: 18
Joined: 11 May 2022, 01:05

Re: send mail via Outlook

12 May 2022, 08:49

Hi
Is it possible to add more text to the mail then above.
animagus46
Posts: 23
Joined: 19 Dec 2014, 15:23

Re: send mail via Outlook [solved]

01 Jun 2022, 06:39

merd.... [solved]
that is the right command.. :shock:

I can't figure out what the command should look like
How can i use variables for e-mail adress?

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

many thanks for a tip

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 81 guests