Sending email with Outlook with Inputs

Share your favorite FastKeys commands
Post Reply
jcfastkeys
Posts: 15
Joined: Sep 4th, ’21, 23:26

Post by jcfastkeys » Sep 12th, ’21, 21:02

Trying to set up to send an email using Outlook and various inputs. How to I get the Inputs to appear in the Body field Number,Expiry, Sec , Name and Amount.
Also the Email.From does not work.
ThanksJC

^p::
InputBox, Customer
InputBox, number
InputBox, Expiry
InputBox, Sec
InputBox, Name
InputBox, Amount

Outlook := ComObjActive("Outlook.Application")
email := Outlook.Application.CreateItem(0)
email.From := lorrain@canam-ca.com
email.To := "j@ecallontario.com"
email.Body := "Card `n `n Expiry `n `n Sec `n `n Name `n `n Amount $ "
email.Subject := "Payment Info for " Customer
;email.Attachments.Add ;now just need to attach the right files...
email.Display(true)
User avatar
Marko
Posts: 1718
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Sep 13th, ’21, 19:09

You forgot the quotes:
email.From := "lorrain@canam-ca.com"

To create entry fields in the script you need to learn Gui command:
https://www.autohotkey.com/docs/commands/Gui.htm

It is easier to simply use Manual Input macros and then Insert Command macro with the mail code.
https://fastkeysautomation.com/document ... dCode.html
Post Reply