Send the information to my mail

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Hema Elkady
Posts: 90
Joined: 01 Feb 2021, 03:45

Send the information to my mail

29 Apr 2021, 10:20

I want it when the person enters anything in the username and password field
I receive the mail, for example, how is that?
Also, I want to hide the text that he writes in the password field

Code: Select all

#SingleInstance, force
Gui,Font, cLime,, comic sans Ms
;----------------------------
Gui -Resize -
Gui +AlwaysOnTop +ToolWindow +LastFound
height := A_ScreenHeight-485
Gui, Add, Edit, r1 vMyEdit w160, Enter Your Email
Gui, Add, Edit, r1 vMyEdit1 w160, Enter Your Password 
Gui, Show, x0 y%height%
Gui, Show, NoActivate w180 h70, Hema
Gui, Color, Black 

Return
;------------------------------------
Guiclose:
	ExitApp
	return
;------------------------------------
User avatar
FanaticGuru
Posts: 1906
Joined: 30 Sep 2013, 22:25

Re: Send the information to my mail

29 Apr 2021, 15:43

Hema Elkady wrote:
29 Apr 2021, 10:20
I want it when the person enters anything in the username and password field
I receive the mail, for example, how is that?
Also, I want to hide the text that he writes in the password field

Code: Select all

#SingleInstance, force
Gui,Font, cLime,, comic sans Ms
;----------------------------
Gui -Resize -
Gui +AlwaysOnTop +ToolWindow +LastFound
height := A_ScreenHeight-485
Gui, Add, Edit, r1 vMyEdit w160, Enter Your Email
Gui, Add, Edit, r1 vMyEdit1 w160, Enter Your Password 
Gui, Show, x0 y%height%
Gui, Show, NoActivate w180 h70, Hema
Gui, Color, Black 

Return
;------------------------------------
Guiclose:
	ExitApp
	return
;------------------------------------

There is a Password option for a Gui that handles hiding passwords.

Code: Select all

#SingleInstance, force
Gui,Font, cLime,, comic sans Ms
;----------------------------
Gui -Resize -
Gui +AlwaysOnTop +ToolWindow +LastFound
height := A_ScreenHeight-485
Gui, Add, Edit, r1 vMyEdit w160, Enter Your Email
Gui, Add, Edit, r1 vMyEdit1 w160 Password, Enter Your Password 
Gui, Show, x0 y%height%
Gui, Show, NoActivate w180 h70, Hema
Gui, Color, Black 

Return
;------------------------------------
Guiclose:
	ExitApp
	return
;------------------------------------
I am not sure what you mean by "I receive the mail". Are you wanting this script to email you some information?

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
Hema Elkady
Posts: 90
Joined: 01 Feb 2021, 03:45

Re: Send the information to my mail

29 Apr 2021, 16:11

FanaticGuru wrote:
29 Apr 2021, 15:43
Hema Elkady wrote:
29 Apr 2021, 10:20
I want it when the person enters anything in the username and password field
I receive the mail, for example, how is that?
Also, I want to hide the text that he writes in the password field

Code: Select all

#SingleInstance, force
Gui,Font, cLime,, comic sans Ms
;----------------------------
Gui -Resize -
Gui +AlwaysOnTop +ToolWindow +LastFound
height := A_ScreenHeight-485
Gui, Add, Edit, r1 vMyEdit w160, Enter Your Email
Gui, Add, Edit, r1 vMyEdit1 w160, Enter Your Password 
Gui, Show, x0 y%height%
Gui, Show, NoActivate w180 h70, Hema
Gui, Color, Black 

Return
;------------------------------------
Guiclose:
	ExitApp
	return
;------------------------------------

There is a Password option for a Gui that handles hiding passwords.

Code: Select all

#SingleInstance, force
Gui,Font, cLime,, comic sans Ms
;----------------------------
Gui -Resize -
Gui +AlwaysOnTop +ToolWindow +LastFound
height := A_ScreenHeight-485
Gui, Add, Edit, r1 vMyEdit w160, Enter Your Email
Gui, Add, Edit, r1 vMyEdit1 w160 Password, Enter Your Password 
Gui, Show, x0 y%height%
Gui, Show, NoActivate w180 h70, Hema
Gui, Color, Black 

Return
;------------------------------------
Guiclose:
	ExitApp
	return
;------------------------------------
I am not sure what you mean by "I receive the mail". Are you wanting this script to email you some information?

FG
There should be a button
And when he clicks on it, what he wrote is sent to my email
User avatar
FanaticGuru
Posts: 1906
Joined: 30 Sep 2013, 22:25

Re: Send the information to my mail

30 Apr 2021, 17:30

Hema Elkady wrote:
29 Apr 2021, 16:11
There should be a button
And when he clicks on it, what he wrote is sent to my email

This can be a real problem if you do not know the environment the script is going to be running within.

If you know for sure the computer the script is going to run on has Outlook installed then it is pretty easy. If you know the computer has CDO that is also pretty easy. The problem is not knowing what email programs are going to be on the computer.

Doing email from scratch without relying on another program is pretty difficult. I have never seen it done in AHK. Even advanced languages like C require a pretty extensive library to send emails.

Your script could install some email software if needed but that is pretty evasive. Even just something like CDO which is already installed in some versions of Windows.

Also there is a security issue in that any method is going to need to have the email servers credentials that anyone with access to the script with be able to gain by looking at the script's code.

Long story short... what you want is doable if you control the computer it is run on but not easy for a script that is expected to work on any computer.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
User avatar
flyingDman
Posts: 2817
Joined: 29 Sep 2013, 19:01

Re: Send the information to my mail

30 Apr 2021, 18:34

Agree 100% with @FanaticGuru . There are times that this could work very nicely though (for instance for sending automated reports). Just in case you want to pursue the CDO route here is the (rather old) script that still works for me with Gmail: https://autohotkey.com/board/topic/60813-cdo-com-email-delivery-ahk-l/ . Note that Gmail requires you to use the "app" password and you'll need the 2-Step verification to be turned on. See here https://support.google.com/mail/answer/185833?hl=en. Your regular password won't work. This script can send emails with attachments and the body can be customized using HTML.
14.3 & 1.3.7
malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: Send the information to my mail

30 Apr 2021, 18:56

Doing email from scratch without relying on another program is pretty difficult. I have never seen it done in AHK. Even advanced languages like C require a pretty extensive library to send emails.
It is not so diificult.
You can send emails with winhttprequest practically from any mail server or with online anonymous email senders help.
User avatar
FanaticGuru
Posts: 1906
Joined: 30 Sep 2013, 22:25

Re: Send the information to my mail

03 May 2021, 12:18

malcev wrote:
30 Apr 2021, 18:56
Doing email from scratch without relying on another program is pretty difficult. I have never seen it done in AHK. Even advanced languages like C require a pretty extensive library to send emails.
It is not so diificult.
You can send emails with winhttprequest practically from any mail server or with online anonymous email senders help.

I would very much like to see the code for this not so difficult sending of emails with winhttprequest.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
AHKStudent
Posts: 1472
Joined: 05 May 2018, 12:23

Re: Send the information to my mail

03 May 2021, 12:52

FanaticGuru wrote:
03 May 2021, 12:18
malcev wrote:
30 Apr 2021, 18:56
Doing email from scratch without relying on another program is pretty difficult. I have never seen it done in AHK. Even advanced languages like C require a pretty extensive library to send emails.
It is not so diificult.
You can send emails with winhttprequest practically from any mail server or with online anonymous email senders help.

I would very much like to see the code for this not so difficult sending of emails with winhttprequest.

FG
read the posts by @malcev here https://www.autohotkey.com/boards/viewtopic.php?f=5&t=32410
User avatar
FanaticGuru
Posts: 1906
Joined: 30 Sep 2013, 22:25

Re: Send the information to my mail

03 May 2021, 14:16

AHKStudent wrote:
03 May 2021, 12:52
FanaticGuru wrote:
03 May 2021, 12:18
malcev wrote:
30 Apr 2021, 18:56
Doing email from scratch without relying on another program is pretty difficult. I have never seen it done in AHK. Even advanced languages like C require a pretty extensive library to send emails.
It is not so diificult.
You can send emails with winhttprequest practically from any mail server or with online anonymous email senders help.

I would very much like to see the code for this not so difficult sending of emails with winhttprequest.

FG
read the posts by @malcev here https://www.autohotkey.com/boards/viewtopic.php?f=5&t=32410

That looks like a long ways from an example of sending an email with winhttprequest.

I assume the approach is get all the authentication to work so you can log in to gmail and access its API to send an email. Kind of a super automated web based email interface.

Basically talk to a website that talks to an email server instead of trying to use SMTP to talk directly to a email server.

Still would like to see a working (other than password etc, or heck make a throw away gmail account that does actual work) example of sending an email in a script that can be run from most Windows computers without additional software. Would really like to see an example that could send an email through a standard email server with bonus points for TLS encryption.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: Send the information to my mail

03 May 2021, 17:41

Still would like to see a working (other than password etc, or heck make a throw away gmail account that does actual work) example of sending an email in a script that can be run from most Windows computers without additional software
We have socket library.
Just use it and write example.
For me such a task is not actual, because I use cdo, winhttprequest or telegram bot api.
BTW You can test/modify this example
https://github.com/johnko/checkmail-ahk/blob/master/checkmail.ahk
malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: Send the information to my mail

06 May 2021, 02:22

Here is very good article with sample c++ code how to implent TLS with Schannel in WinApi.
https://sites.google.com/site/libfcgi2/tls-with-schannel

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Chunjee, gsxr1300, inseption86, jaka1, mebelantikjaya and 298 guests