Jump to content
Sign in to follow this  
PhoenixXL

Remote Gmail (UDF)

Recommended Posts

PhoenixXL

Remote Gmail UDF


Working
It uses the Google atom API to get the Summary of the mail,
The Summary of the mail is enough to get a direct link or a single function with parameters
Execute any Function (or Script) and get the Return Values in your E-mail

Requirements

  • Gmail (Email) Account
  • A Remote Computer with Internet Access

Representation
remotegmail.png
Functions

  • You can now use you Gmail account to use Autoit Functions in a remote computer
  • Can execute a function through reading the email.
  • Can Email back the return values of an executed function.
  • The parameter can even be a variable present in the script [see Syntax]
  • Execute a Script through Direct Link.
  • Execute multiple scripts zipped together through Direct Link.
  • Can Email back the PID of the running executables with the scripts.
  • Attach any file and get it in your email.
  • Able to send the multiple attachments zipped together.
  • Writes all the return values in a Log file.
  • No email is executed twice, the Message IDs are stored for this purpose.

Future Updates

  • Support single line nesting
  • Get the attachment, to execute the script

Syntax

Syntax for Functions
PXL<FuncName>: (<data type>)<first param part a>+(<data type>)<first param part b>|(<data type>)<secondparam>/PXL

Colon[:] - Separation of Function Name with the Parameters
Bar [ | ] - Separation of different parameters
Plus [+] - To Concatenate Values
PXL /PXL - The tags where the code is enclosed
Brackets [ () ] - For specifying the type of the parameter

DataTypes - Always Preceded by any parameter and are enclosed with brackets

; | (s) - String
; | (n) - Number
; | (f) - Floating Number
; | (i) - Integer
; | (b ) - Binary
; | (v) - Variable
; | (h) - Hex
; | (m) - macro
; | (w) - Handle
; | (p) - Pointer


Syntax for Direct Links
PXL<DirectLink>^<Type>/PXL

PXL /PXL - The tags where the code is enclosed
Caret [ ^ ] - To Separate the Link and the Type
Type - Either Zip or au3

DirectLink WebServer
Some of webservers providing Direct Links
DropBox [Tested - Recommended]
Herosh [Tested]*
FileToLink
FileDen

* DirectLink from Herosh changes therefore Example 4 wont work after a while

Credits
CaptainClucks - Atom Feed
Jos - SMTP Mailer
wraithdu - Zip UDF

Change Log
v1.0 - First Release
v1.1 - Added Script Execution with Zipping Functionality
v1.2 - Fixed some Minor bugs
v1.3 - Added RemoteGmail_Startup
v1.4 - Fixed Compiling Issues

v1.5 - Added flexibility for execution of scripts from any email.

The UDF - Download
The UDF is currently tested on x86
All Comments ,Queries , Feedback and Advice are welcomed... :)
The UDF with the Examples have been compiled in the following Zip

v1.5 RemoteGmail.7z
Previous Downloads : 1119

Regards
Phoenix XL

Edited by PhoenixXL
  • Like 4

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites
PhoenixXL

24 Downloads yet no Reply

Please give me Feedback and Suggestions

Regards

Phoenix XL

  • Like 1

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites
BasicOs

hI, GREAT IDEA, you can have a look AT mine here, similar THAN yours, but using a mysql db instead, it includes also a browser link to work for starting the script from an IPHONE-ANDROID smartphone --> INTO a autoit APP Client(via php and mysql and this remote Autoit app client)

I write there a link also for another internet "automator".

I posted your script-link in our Autoit SPANISH SUPPORT GROUP FORUM HERE:

LINK

THANKS

SALUDOS

PD: España-France Football MATch IS tomorrow.

Edited by BasicOs

Autoit.es - Foro Autoit en Español Word visitors Image Clustrmap image: - Football Spanish team - Spanish team: Casillas, Iniesta, Villa, Xavi, Puyol, Campdevilla, etc..Programando en Autoit+Html - Coding Autoit-Html - Arranca programas desde Internet - Preprocesador de Autoit a http

Share this post


Link to post
Share on other sites
CptSpike

This is pretty smart - I can see that this has great potential. Nice work.

-CptSpike

Share this post


Link to post
Share on other sites
PhoenixXL

v1.1 has been released

Check the First Post


My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites
PhoenixXL

hI, GREAT IDEA

Thanks BasicOS :) Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites
PhoenixXL

thanks CptSpike :graduated:

Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites
PhoenixXL

oops forgot to add the script.. :rolleyes:

.

.

please check the first post


My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites
kkpmb

Hi Phoenix, a good tool for administering network remotely. I downloaded, but could not understand how to go configuring remote computers and put them in to listening mode.

Is there any help file showing how to start?

Share this post


Link to post
Share on other sites
PhoenixXL

This will help you achieve a continuous loop to check and execute the emails till the compter isnt turned off or the Process isnt killed

;For Version 1.2 only
;Check Continuously
Opt('TrayIconDebug', 1)


Global $sUsername = 'myusername' ; Your Username for Example if phoenixxl@gmail.com is your Gmail Address then phoenixxl would be your username
Global $sPassword = '********' ; Your Password for your Gmail Account
Global $iTimeOut = 12000
#include <RemoteGmail.au3>

;The Function would be executed every 12 Seconds.
;Hence all the New mails would be checked and executed every 12000 milli Seconds
AdlibRegister('RemoteGmail',$iTimeOut)

;Our Infinite Loop
While 1
Sleep(10)
WEnd

Just give your username and password

Send yourself an email with your email address and get the script or Function executed

One more tip : to execute the mails when user goes idle check Idle Process in my Signature

Regards

Phoenix XL

Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites
kiu

Hello Pheonix

I found a bug; it's in the part where _ExecuteFromEmail function is calling _GetfromDirectLink function; first parameter contains the ^zip in it so the link is incorrect; _GetfromDirectLink function do'nt catch the error, so _ExecuteFromEmail crashes because $nArrays is not a array. My correction (simplest for me) was this:

Local $nFile = GetfromDirectLink(StringTrimRight($sExecute, 4), @ScriptDir &amp; 'Temp.' &amp; $nType)

Anyway, great job, i was using a script similar with this, but yours is much better; thank you, and maybe we'll expand it; I have some ideas, but I will post them later.

Thanks , Paul

edit: sorry for my bad english

Edited by kiu

Share this post


Link to post
Share on other sites
PhoenixXL

Thanks kiu,

I have updated the UDF

please check the first post


My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites
EmptySpace

When I try to start any code i get error from string.au3

Func _HexToString($strHex)

If StringLeft($strHex, 2) = "0x" Then Return BinaryToString($strHex)

Return BinaryToString("0x" & $strHex)

EndFunc ;==>_HexToString

Its says that missing wend, endswitch. I try to change something and I get errors from remotegmail.au3 .

I make ant imput box with button. I want to put there text, click button and get text into gmail .

Share this post


Link to post
Share on other sites
water

Such messages are (most of the time) not caused by the UDF but by the user code missing a closing quote or something like that.

Running Tidy has often shown where the problem is.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
water

Just tried your script you sent me by PM and it works fine. Autoit 3.3.8.1, latest GMail UDF. Running on Windows 7 64 bit.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
EmptySpace

Thats strange. I get errors from udf. Need to check my autoit version. Also my win is xp.

Share this post


Link to post
Share on other sites
water

Can you post the output of the SciTE console pane? Which error messages do you get there? Line number etc?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
water

C:Documents and SettingsxxxxDesktopRemoteGmailv1.2 RemoteGmailRemoteGmail.au3(10,29) : WARNING: $sUsername: possibly used before declaration.
Global $sEmail = $sUsername &
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:Documents and SettingsxxxxDesktopRemoteGmailv1.2 RemoteGmailRemoteGmail.au3(60,53) : WARNING: $sPassword: possibly used before declaration.
Local $eReturn = _CheckGmail($sUsername, $sPassword,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:Documents and SettingsxxxxDesktopRemoteGmailv1.2 RemoteGmailTest.au3 - 0 error(s), 2 warning(s)
->13:41:40 AU3Check ended. Press F4 to jump to next error.rc:1
>Running:(3.3.8.1):C:Program FilesAutoIt3autoit3.exe "C:Documents and SettingsxxxxDesktopRemoteGmailv1.2 RemoteGmailTest.au3"
--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
C:Documents and SettingsxxxxDesktopRemoteGmailv1.2 RemoteGmailRemoteGmail.au3 (10) : ==> Variable used without being declared.:
Global $sEmail = $sUsername & '@gmail.com'
Global $sEmail = ^ ERROR
->13:41:40 AutoIT3.exe ended.rc:1
>Exit code: 1 Time: 2.618
You access a variable ($sUsername) before it has been declared. Move the variable declaration/assignment to the top of your script (before the GMail include) and the error should go away:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Global $sUsername = "myemail"
Global $sPassword = "password"
Global $texttosend

#include <RemoteGmail.au3>

#region ### START Koda GUI section ### Form=
GUICreate("Test", 300, 72, 296, 260)
$Input1 = GUICtrlCreateInput("Put some text", 8, 8, 281, 21)
$send = GUICtrlCreateButton("Send Gmail", 8, 32, 283, 25)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
          Exit
        Case $send
            $texttosend = GUICtrlRead($Input1)
            SendEmail2Gmail($texttosend, '', 0, 'Execute')
    EndSwitch
WEnd
Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
EmptySpace

Thanks!So stupid mistake. When I tried to put that variables before includes then I got errors from string.au3..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • Gowrisankar
      By Gowrisankar
      Dear members,
      I'm trying to get the attachments from mails using OutlookEx UDF and then save them in a particular location.
      The UDF considers even the signature images and other images in the mail body as attachments, and saves it in the folder I point. I want only the proper attachment documents to be saved.
      Requesting the guidance of the forum members.
       
       
      Thanks and regards,
      Gowrisankar R.
    • Gowrisankar
      By Gowrisankar
      Dear members,
      I'm trying to move unread mails from Inbox to a different folder using OutlookEx UDF.
      But its not working for me. I'm not sure what mistake I do.
      I get the error code 6 when the following is executed. From the UDF it is observed that  "No or an invalid item has been specified".
      Note : The UDF version is 1.3.3.1. AutoIt version (v3.3.14.2).
      #include <OutlookEX.au3> Global $oOutlook = _OL_Open() If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended) Global $aOL_Item = _OL_ItemFind($oOutlook, "*\Inbox", $olMail, "[UnRead]=True", "", "", "Subject", "", 1) If $aOL_Item[0][0] = 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemMove Example Script", "Could not find a task item in folder 'Outlook-UDF-Test\SourceFolder\Tasks'. @error = " & @error) _ArrayDisplay($aOL_Item, "OutlookEX UDF: _OL_ItemFind Example Script - Unread mails") _OL_ItemMove($oOutlook, $aOL_Item[1][0], Default, "*\Outlook-UDF-Test\TargetFolder\Mail") If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemMove Example Script", "Error moving specified task. @error = " & @error) Any help is deeply appreciated. Thanks in advance.
      Thanks and regards,
      Gowrisankar R.
    • FrancescoDiMuro
      By FrancescoDiMuro
      Good morning everyone

      I was playing a little bit with "Screen Capture" UDF, and I was trying to make a "Window" capture, but, since I made a GUI which through I fire the event "Capture", my GUI is captured as well, and I don't want to
      This is the line of code that makes the capture:
       
      _ScreenCapture_CaptureWnd($strScreenCaptureFileName, $objActiveWindow, 0, 0, -1, -1, False) And these are the lines of code which select the "active" window:
       
      Local $objCurrentWindow = 9999 If _IsPressed("01") Then $objCurrentWindow = WinGetHandle("[ACTIVE]") If $objCurrentWindow <> $objMyGUI Then $objActiveWindow = $objCurrentWindow EndIf EndIf Sorry If I made stupid mistakes
      Thanks in advance.

      Francesco
    • TheDcoder
      By TheDcoder
      Hello everyone, long time since I made a post in the H&S sub-forum
      I am working on a project where in a situation I would have to hold down an arrow key and release it in another statement/command, however when I wrote the code it isn't working exactly like I thought it would. Here is an example:
      Send("{UP down}") Sleep(10000) Send("{UP up}") This should hold the up arrow key for 10 seconds before releasing it again, but when I run this code the cursor in SciTE moves up only once
      If I hold the up arrow manually for 10 seconds it "repeats" and the cursor moves up several times until I release the key... Is this a known limitation of Send? Is there any other way I can accomplish this?
      Thanks for all the help and feedback in advance! TD
    • kcvinu
      By kcvinu
      Hi all,
      I am playing with _GUICtrlButton_Create function. How can i change this button's (or the entire form's) font ?. The in-built GUICtrlSetFont function is not working even when i convert the control handle to control ID with _WinAPI_GetDlgCtrlID ( ) function.  Do i need to use CreateFont api finction and send WM_SETFONT message ? Or is there any other easy and safe ways to do this ?. Thanks in advance.
      Note : This window is created by CreateWindowEx function, not by GUICreate function. 
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.