Page 2 of 2

Re: Send Email Directly from AutoHotkey

Posted: 13 Jan 2021, 07:36
by daywalker
Nice script. How to realise NOREPLY emails?

Re: Send Email Directly from AutoHotkey

Posted: 17 Jan 2021, 01:45
by zvit
Works great but I have a question. I have nice email templates that were created via HTML. (I use CloudHD email templates plugin) Is there a way to have the email sent in an HTML format? Meaning, that in ahk I would either paste the HTML or have ahk read the HTML from the HTML template file?

Re: Send Email Directly from AutoHotkey

Posted: 24 Feb 2021, 07:19
by DRocks
Very nice thanks a lot! I've been wondering about that for a while.

Here's a snippet how I made a working attachment test:

Code: Select all

; Attachment feature separated by |
facture := A_ScriptDir . "\Facture-18.pdf"
doc1 := A_ScriptDir . "\doc1.pdf"
doc2 := A_ScriptDir . "\doc2.pdf"

sAttach := facture "|" doc1 "|" doc2 ; can add multiple attachments (the delimiter is "|" )

Re: Send Email Directly from AutoHotkey

Posted: 04 Aug 2021, 12:37
by bdrumm
image.png
(10.57 KiB) Downloaded 100 times
the URL:

Code: Select all

http://schemas.microsoft.com/cdo/configuration/
is down.

This script wont work without that URL.

Re: Send Email Directly from AutoHotkey

Posted: 04 Aug 2021, 14:00
by JoeWinograd
bdrumm wrote:This script wont work without that URL.
I'm hoping for "temporarily unavailable", as a removal or a name change would break a gazillion programs/scripts. Give it a while and try again later.

Btw, here's a thread that I posted about CDO, but it has a PowerShell solution that does not rely on http://schemas.microsoft.com/cdo/configuration/, so you may want to give that a try:

https://www.autohotkey.com/boards/viewtopic.php?f=76&t=67283

Regards, Joe

Re: Send Email Directly from AutoHotkey

Posted: 10 Apr 2022, 12:01
by Albireo
Is this really a possible way to solve this on?

Re: Send Email Directly from AutoHotkey

Posted: 15 May 2022, 16:39
by tantomed
New user here. Got the Gmail to work...also had to manually select "allow less secure apps," but did anyone else see that Gmail has a notification above this option now that says "As of May 31, 2022 we will no longer allow less secure apps" or something like that? Anyone have a good backup? I tried multiple other email clients, and perhaps just dont have the script/ports/etc right, but I basically tried both the original posters code (that works with Gmail), plus I have tried the reposters variants where TLS should work (vs SSL), but so far cant get Outlook, AOL, Yahoo, or Yandex to work, despite making sure I am using the correct SMTP address and the correct port. Port 25 is blocked for me on ATT Fiber. Any thoughts?

Re: Send Email Directly from AutoHotkey

Posted: 15 May 2022, 23:45
by 1apsalman1
hi, i'm noob. I tried the source, but an error occurred and I don't know how to solve it, so I leave a question.
The message could not be sent to the SMTP server. The transmission error code is 0x80040217 . The server response is not available .
---> 034: pmsg.Send()

Re: Send Email Directly from AutoHotkey

Posted: 16 May 2022, 06:48
by Albireo
What is not working?
Or more importantly what is it you want to do?
(some code?)

Re: Send Email Directly from AutoHotkey

Posted: 18 May 2022, 22:19
by tantomed
Albireo wrote:
16 May 2022, 06:48
What is not working?
Or more importantly what is it you want to do?
(some code?)

When I use gmail with the provided code, it works well (sending an email when the "if" occurs). So this first one is working...but at the end of this month I dont think it will anymore given the notice I saw in Gmail about no longer allowing "less secure apps."

Code: Select all

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 := "username@gmail.com"
fields.sendpassword := "Password"
fields.smtpconnectiontimeout := 60
schema := "http://schemas.microsoft.com/cdo/configuration/"  ; Do not change
So in order to find an alternative, I tried Outlook, Aol, Yahoo, Yandex. I made sure to use the proper smtp server/port info I found on their websites/online. None worked using the original Gmail code above (likely because require TLS), but even when I tried to add in TLS (with multiple different port options), it didnt work (see below for just two examples). Basically tried added fields.sendtls instead of fields.smtpusessl, or tried both, then tried multiple port options with this.

Code: Select all

fields := Object()
fields.smtpserver := "smtp-mail.outlook.com" ; specify your SMTP server
fields.smtpserverport := 587
fields.sendtls := True
fields.sendusing := 2 ; cdoSendUsingPort
fields.smtpauthenticate := 1 ; cdoBasic
fields.sendusername := "username@outlook.com"
fields.sendpassword := "Password"
fields.smtpconnectiontimeout := 60
schema := "http://schemas.microsoft.com/cdo/configuration/"  ; Do not change


fields := Object()
fields.smtpserver := "smtp-mail.outlook.com" ; specify your SMTP server
fields.smtpserverport := 465 ; 25
fields.sendtls := True
fields.smtpusessl := True ; False
fields.sendusing := 2 ; cdoSendUsingPort
fields.smtpauthenticate := 1 ; cdoBasic
fields.sendusername := "username@outlook.com"
fields.sendpassword := "Password"
fields.smtpconnectiontimeout := 60
schema := "http://schemas.microsoft.com/cdo/configuration/"  ; Do not change

Re: Send Email Directly from AutoHotkey

Posted: 13 Jun 2022, 23:05
by corcova
@tantomed
im having the same issue. gmail stop working. tried many other smpt mails and none has workd. did you find some alternative?

Re: Send Email Directly from AutoHotkey

Posted: 14 Jun 2022, 01:52
by Albireo
I have not tried using Thunderbird with AHK (but it should work)

Re: Send Email Directly from AutoHotkey

Posted: 14 Jun 2022, 04:14
by lblb
Gmail should still work (it does for me) when you use an App password:

viewtopic.php?f=76&t=102434&p=455402#p455548

Re: Send Email Directly from AutoHotkey

Posted: 14 Jun 2022, 12:21
by corcova
thank you, just created a app password and it is working again. uhuuuuu
lblb wrote:
14 Jun 2022, 04:14
Gmail should still work (it does for me) when you use an App password:

viewtopic.php?f=76&t=102434&p=455402#p455548