Below is the script! but in the email the body only appears what is in quotes, in bold
Code: Select all
inputbox ,setor, Solicitação de toner Laborclin, Digite o setor solicitante:
inputbox ,Nome, Solicitação de toner Laborclin, Digite o nome do solicitante:
inputbox , Impressora ,Solicitação de toner Laborclin , Digite o modelo da impressora:
msgbox, vc digitou %Setor%
pmsg := ComObjCreate("CDO.Message")
pmsg.From := """[email protected]"" <Your gmail address>"
pmsg.To := "[email protected]" ;Sent an email to myself as a test. Perhaps that's why it worked for me.
pmsg.BCC := "" ; Blind Carbon Copy, Invisable for all, same syntax as CC
pmsg.CC := ; "[email protected], [email protected]"
pmsg.Subject := "Solicitação de Toner"
;You can use either Text or HTML body like
pmsg.TextBody := [b]"Solicito toner para o departamento :"[/b] %setor%
;OR
;pmsg.HtmlBody := "<html><head><title>Solicitação de toner</title></head><body><h2>Solicitação de toner</h2><p>Solicito toner para o departamento:</p></body></html>"
sAttach := ;"Path_Of_Attachment" ; can add multiple attachments, the delimiter is |
fields := Object()
fields.smtpserver := "smtp.gmail.com" ; specify your SMTP server
fields.smtpserverport := 465 ; 25
fields.smtpusessl := True ; False
fields.sendusing := 2 ; cdoSendUsingPort
fields.smtpauthenticate := 1 ; cdoBasic
fields.sendusername := "[email protected]"
fields.sendpassword := "zzzzzzzz"
fields.smtpconnectiontimeout := 60
schema := "http://schemas.microsoft.com/cdo/configuration/"
pfld := pmsg.Configuration.Fields
For field,value in fields
pfld.Item(schema . field) := value
pfld.Update()
Loop, Parse, sAttach, |, %A_Space%%A_Tab%
pmsg.AddAttachment(A_LoopField)
pmsg.Send()