Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Simplest way for AHK to send email from gmail.com


  • Please log in to reply
9 replies to this topic
bonaparte
  • Members
  • 21 posts
  • Last active: Jan 14 2009 05:06 AM
  • Joined: 17 Dec 2008
I'm trying to write my AHK script to send an e-mail. I would be sending the 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!

  • Guests
  • Last active:
  • Joined: --
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()

}


bonaparte
  • Members
  • 21 posts
  • Last active: Jan 14 2009 05:06 AM
  • Joined: 17 Dec 2008
Thanks Guest, but I get an error at line 4: Contains illegal character. It's not the " marks either, I tried it without them.

Alpha Bravo
  • Members
  • 1687 posts
  • Last active: Nov 07 2015 03:06 PM
  • Joined: 01 Sep 2011
this is a working example
http://www.autohotke...Message#p403177

JaneLove90
  • Members
  • 1 posts
  • Last active: Feb 18 2013 09:54 PM
  • Joined: 23 Jan 2013

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() 

}


Alpha Bravo
  • Members
  • 1687 posts
  • Last active: Nov 07 2015 03:06 PM
  • Joined: 01 Sep 2011

I have tried your function with the following paramaters and it worked fine

fields.smtpserver := "smtp.gmail.com" 
fields.smtpserverport := 465
fields.smtpusessl := true


Guest10
  • Members
  • 1216 posts
  • Last active: Oct 30 2015 05:12 PM
  • Joined: 27 Oct 2012

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)???



IsNull
  • Moderators
  • 990 posts
  • Last active: May 15 2014 11:56 AM
  • Joined: 10 May 2007
To inline pictures etc. mostly there is html used as descriptor of the body instead of plaintext.

Guest10
  • Members
  • 1216 posts
  • Last active: Oct 30 2015 05:12 PM
  • Joined: 27 Oct 2012

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



flyingDman
  • Spam Officer
  • 2186 posts
  • Last active: Nov 07 2015 08:15 AM
  • Joined: 27 Feb 2009

@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.”