
Simplest way for AHK to send email from gmail.com
example of what I'm trying to do:
If var=8
{
send e-mail from <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e --> to <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->, subject = check news, text body = the news is good
}
I know something like this must have been asked before, but spending 40 minutes in search just made me more confused.
Thanks all!

SendMail(sender, senderPass, receiver, subject, message) { fields := Object() fields.smtpserver := "smtp.gmail.com" fields.smtpserverport := 465 fields.smtpusessl := True fields.sendusing := 2 fields.smtpauthenticate := 1 fields.sendusername := sender fields.sendpassword := senderPass fields.smtpconnectiontimeout := 60 schema := "http://schemas.microsoft.com/cdo/configuration/" pmsg := ComObjCreate("CDO.Message") pmsg.To := receiver, pmsg.Subject := subject, pmsg.TextBody := message, pmsg.From := fields.sendusername pfld := pmsg.Configuration.Fields For field,value in fields pfld.Item(schema . field) := value pfld.Update() pmsg.Send() }



Hi Friends.
Please help me.....
What is the proglem in this function
SendMail(sender, senderPass, receiver, subject, message) { fields := Object() fields.smtpserver := "smtp.live.com" fields.smtpserverport := 587 fields.smtpusessl := false fields.sendusing := 2 fields.smtpauthenticate := 1 fields.sendusername := sender fields.sendpassword := senderPass fields.smtpconnectiontimeout := 60 schema := "http://schemas.microsoft.com/cdo/configuration/" pmsg := ComObjCreate("CDO.Message") pmsg.To := receiver, pmsg.Subject := subject, pmsg.TextBody := message, pmsg.From := fields.sendusername pfld := pmsg.Configuration.Fields For field,value in fields pfld.Item(schema . field) := value pfld.Update() pmsg.Send() }

I have tried your function with the following paramaters and it worked fine
fields.smtpserver := "smtp.gmail.com" fields.smtpserverport := 465 fields.smtpusessl := true

How can this script be modified to send text attachments INLINE (so that text appears in the body of email message the same as "attachi" option in BLAT)???


Does this mean inline text attachment as in BLAT (attachi) is NOT possible?

@janelove90
What error message are you getting? Is this a Microsoft Live account?
The method you are using is fine and works with Gmail as also verified by Alpha Bravo above. It also works with my GMX account which all rely on SSL.
I had the same issues - which remain unsolved here - with an Office 365 / Outlook / Sharepoint account (ie Microsoft). I think it has to do with the encryption method which is not SSL but TSL.
Would love to have someone resolved this...

Marine Corps Gen. Joseph Dunford told senators at his Joint Chiefs of Staff confirmation hearing : “If you want to talk about a nation that could pose an existential threat to the United States, I'd have to point to Russia. And if you look at their behavior, it's nothing short of alarming.”