Page 1 of 1

Sending email with Outlook with Inputs

Posted: Sep 12th, ’21, 21:02
by jcfastkeys
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 := [email protected]
email.To := "[email protected]"
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)

Re: Sending email with Outlook with Inputs

Posted: Sep 13th, ’21, 19:09
by Marko
You forgot the quotes:
email.From := "[email protected]"

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