Sending emails (gmail) with autohotkey) Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
beginnerprogrammer

Sending emails (gmail) with autohotkey)

30 Jan 2017, 07:09

Dear all,

I was using the following code with windows 7 and everything was working, but when I use the same code on windows 10, it stopped working and gave me the error found below further down;

Code that used to work for me in windows 7:
emailtosomeone = bla bla bla

pmsg := ComObjCreate("CDO.Message")
pmsg.From := """John Agius"" <something@gmail.com>"
pmsg.To := "somtehting@gmail.com"
pmsg.BCC := ""
pmsg.CC := ""
pmsg.Subject := "Message / Note"
pmsg.TextBody :=emailtosomeone
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 := "user@gmail.com"
fields.sendpassword := "password"
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()
pmsg.Send()

In windows 10 it is giving me the following error;

Error: 0x800CCE05
Source: CDO.Message.1
Description: The requested body part was not found in this message
HelpFile (Null)
HelpContext: 0

Specifically from;
;bla bla bla working code
-------> pmsg.From :="""John Agius"" <something@gmail.com>"


Could someone please help me? I really need this to work for my job.

Thanks

John Agius
User avatar
Capbat
Posts: 101
Joined: 17 May 2014, 13:33
Location: Québec Canada

Re: Sending emails (gmail) with autohotkey)

30 Jan 2017, 11:54

I have the same problem with this. I have tried a lot of different script trying to use gmail and I always get error I am on windows 10 also. The error I am getting these day with the above script is 'Transport Error 0x800040217. The message could not be sent to the SMTP server. I am getting this at the pmsg.Send() command.

Anyone?

Bat
beginnerprogrammer

Re: Sending emails (gmail) with autohotkey)

30 Jan 2017, 14:13

I cannot even get to send without this error. In windows 7 and XP this exact same script works perfectly fine. I have update versions of Autohotkey,
iPhilip
Posts: 835
Joined: 02 Oct 2013, 12:21

Re: Sending emails (gmail) with autohotkey)

31 Jan 2017, 02:00

You might the code I posted here and see if it works for you.

Cheers!
Windows 10 Pro (64 bit) - AutoHotkey v2.0+ (Unicode 64-bit)
RAMON LLOYDS

Re: Sending emails (gmail) with autohotkey)  Topic is solved

31 Jan 2017, 02:36

Error: Call to nonexistent function

---> 199. asm := CLR_CompileC#(c#, "System.dll")
iPhilip
Posts: 835
Joined: 02 Oct 2013, 12:21

Re: Sending emails (gmail) with autohotkey)

31 Jan 2017, 11:17

RAMON LLOYDS wrote:Error: Call to nonexistent function

---> 199. asm := CLR_CompileC#(c#, "System.dll")
Sorry. You have to download CLR here and add the following line at the end of my script:

Code: Select all

#Include CLR.ahk
Let me know how it works out for you.
Windows 10 Pro (64 bit) - AutoHotkey v2.0+ (Unicode 64-bit)
Tasos
Posts: 3
Joined: 28 Jul 2019, 03:37

Re: Sending emails (gmail) with autohotkey)

03 Aug 2019, 05:37

iPhilip wrote:
31 Jan 2017, 11:17
RAMON LLOYDS wrote:Error: Call to nonexistent function

---> 199. asm := CLR_CompileC#(c#, "System.dll")
Sorry. You have to download CLR here Broken Link for safety and add the following line at the end of my script:

Code: Select all

#Include CLR.ahk
Let me know how it works out for you.
Hi there! As I'm too late for this link
(https dl.dropbox.com /u/20532918/Lib/CLR-1.2.zip) Broken Link for safety
would it be possible to provide a new one? A also need to send emails on WIN10. Thanks in advance!
iPhilip
Posts: 835
Joined: 02 Oct 2013, 12:21

Re: Sending emails (gmail) with autohotkey)

03 Aug 2019, 11:11

@Tasos, You can find @lexikos's code here.
Windows 10 Pro (64 bit) - AutoHotkey v2.0+ (Unicode 64-bit)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Draken, Spawnova, william_ahk and 256 guests