Sign in to follow this  
Followers 0
slaughter

Gmail 'Check email from other accounts' speeduper

1 post in this topic

#1 ·  Posted (edited)

Emails if is taken from other sources gmail account some times takes ages to arrive or you have very time to do it by yourself going in option and clicking "Check mail now"

Solution is automated script witch does it for you while your pc is running.

Has one problem

ID of elements 'Check_mail_now' always changing so you have to adjust it, maybe someone can offer solution?

At his moment it clicks on tow other accounts, but you can always add more. :)

 

Sorry for posting maybe in wrong section, it is like an demo but needs some help :) Maybe admins can move topic to help section. Thanks.

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.8.1
 Author:         myName

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here
$url1="https://accounts.google.com/ServiceLogin?service=mail&continue=https://mail.google.com/mail/"
$url2="https://mail.google.com/mail/u/0/?shva=1#settings/accounts"
$email="xxx@gmail.com"
$password="my password"
$check_interval_min="2"
$id_of_Check_mail_now1 = ":f42"
$id_of_Check_mail_now2 = ":f46"



#include <IE.au3>
Local $oUser, $oPass, $oSubmit, $oInput
$oIE = _IECreate ($url1,1,0)
_IELoadWait($oIE)


Local $oForm = _IEFormGetObjByName($oIE, "gaia_loginform")
Local $input_username = _IEFormElementGetObjByName($oForm, "Email")
_IEFormElementSetValue($input_username, $email)
Local $input_userpass = _IEFormElementGetObjByName($oForm, "Passwd")
_IEFormElementSetValue($input_userpass, $password)
ConsoleWrite("form submit1."&@CRLF)
Local $oSubmit = _IEGetObjByName($oIE, "signIn")
_IEAction($oSubmit, "click")
;_IEFormSubmit($oForm)
ConsoleWrite("form submit2."&@CRLF)
_IELoadWait($oIE)
Sleep(4000)
ConsoleWrite("Login complete. Navignating to settings."&@CRLF)
_IENavigate($oIE, $url2)
_IELoadWait($oIE)
Sleep(2000)


While 1
    $oDiv = _IEGetObjById($oIE, $id_of_Check_mail_now1)
    _IEAction($oDiv, "click")
    $oDiv = _IEGetObjById($oIE, $id_of_Check_mail_now2)
    _IEAction($oDiv, "click")
    Sleep($check_interval_min*1000*60)
WEnd
Edited by slaughter

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  
Followers 0

  • Similar Content

    • Ascer
      By Ascer
      1. Description.
      oAuth 2.0 is security system implemented by Google a few years ago. You are able to connect into your Google accounts and manage documents. In this UDF i show you how to pass first authorization process., this allow you to automate most of functions using API interface. 2. Requirements.
      Google account. oAuth.au3 Download 3. Possibilities
      ;============================================================================================================ ; Date: 2018-02-10, 14:21 ; ; Description: UDF for authorize your app with oAuth 2.0 Google. ; ; Function(s): ; oAuth2GetAuthorizationCode() -> Get Code for "grant". ; oAuth2GetAccessToken() -> Get "access_token" and "refresh_token" first time. ; oAuth2RefreshAccessToken() -> Get current "access_token" using "refresh_token". ; ; Author(s): Ascer ;============================================================================================================ 4. Enable your Google API.
          4.1. Video Tutorial not mine!
       YouTube     4.2 Screenshots from authorization process (Polish language) 
      Go to https://console.developers.google.com/apis/dashboard and accept current rules.  

       
      Next create an new project  

       
      Enter name of you new project and click Create  

       
      Google will working now, please wait until finish. Next go to enable your API interface, we make if for Google  

       
      Take "Gmail" in search input and after click in found result.  

       
      Click Enable interface, Google will working now.  

       
      Create your login credentials  

       
      Select Windows Interface (combobox), User credentials (radio) and click button what is need bla bla  

       
      Type name of a new client id for oAuth 2.0 and click Create a new Client ID.  

       
      Next configure screen aplication, type some name and click Next. Google will working now.  

       
      Last step on this website is download source with your credentials in *Json format.  

       
      Now you received a file named client_id.json, it's how it look in Sublime Text:  

       
      5. Coding.
      Now we need to call a some function to get access code.  
      #include <oAuth.au3> Local $sClientId = "167204758184-vpeues0uk6b0g4jrnv0ipq5fapoig2v8.apps.googleusercontent.com" Local $sRedirectUri = "http://localhost" oAuth2GetAuthorizationCode($sClientId, $sRedirectUri)  
      Function will execute default browser for ask you to permission.  

       
      Next Google ask you to permission for access to your personal details by application Autoit   

       
      Now you can thing is something wrong but all is ok, you need to copy all after  code= . It your access code.  

       
      Let's now ask Google about our Access Token and Refresh Token  
      #include <oAuth.au3> Local $sClientId = "167204758184-vpeues0uk6b0g4jrnv0ipq5fapoig2v8.apps.googleusercontent.com" Local $sClientSecret = "cWalvFr3WxiE6cjUkdmKEPo8" Local $sAuthorizationCode = "4/AAAPXJOZ-Tz0s6mrx7JbV6nthXSfcxaszFh_aH0azVqHkSHkfiwE8uamcabn4eMbEWg1eAuUw7AU0PQ0XeWUFRo#" Local $sRedirectUri = "http://localhost" Local $aRet = oAuth2GetAccessToken($sClientId, $sClientSecret, $sAuthorizationCode, $sRedirectUri) If Ubound($aRet) <> 4 then ConsoleWrite("+++ Something wrong with reading ResponseText." & @CRLF) Exit EndIf ConsoleWrite("Successfully received data from Google." & @CRLF) ConsoleWrite("access_token: " & $aRet[0] & @CRLF) ConsoleWrite("expires_in: " & $aRet[1] & @CRLF) ConsoleWrite("refresh_token: " & $aRet[2] & @CRLF) ConsoleWrite("token_type: " & $aRet[3] & @CRLF)  
      Important! When you received error 400 and output says: Invalid grant it means that your previous generated access_code lost validity and you need to generate new calling previus code. When everything is fine you should received a 4 informations about your: access_token, expires_in, refresh_token and token_type. Access_Token time is a little short so you need to know fuction possible to refresh it (tell Google that he should generate a new Token for you)  
      #include <oAuth.au3> Local $sRefreshToken = "1/ba8JpW7TjQH3-UI1BvPaXhSf-oTQ4BmZAbBfhcKgKfY" Local $sClientId = "167204758184-vpeues0uk6b0g4jrnv0ipq5fapoig2v8.apps.googleusercontent.com" Local $sClientSecret = "cWalvFr3WxiE6cjUkdmKEPo8" Local $sRedirectUri = "http://localhost" Local $aRet = oAuth2RefreshAccessToken($sRefreshToken, $sClientId, $sClientSecret) If Ubound($aRet) <> 3 then ConsoleWrite("+++ Something wrong with reading ResponseText." & @CRLF) Exit EndIf ConsoleWrite("Successfully received data from Google." & @CRLF) ConsoleWrite("access_token: " & $aRet[0] & @CRLF) ConsoleWrite("expires_in: " & $aRet[1] & @CRLF) ConsoleWrite("token_type: " & $aRet[2] & @CRLF)  
      6. Finish words
      If you followed all this above steps im sure that you received all informations required for coding your Google API (Gmail, Dropbox, YouTube, Calender etc. See next thread: [UDF] Gmail API - Email automation with AutoIt!
    • Ascer
      By Ascer
      1. Description.
      Automate communication with Gmail API using oAuth 2.0 security. 2. Requirements.
      Google Gmail account. Finished Authorization process. Look here 3. Possibilities.
      ;======================================================================================================================== ; Date: 2018-02-12, 11:46 ; ; Bug Fixs: 2018-02-17, 7:31 -> Fixed problems with adding items to array and minor bugs. ; ; Description: UDF for using Gmail API interface. This UDF requires oAuth.au3 and Gmail account. ; ; Function(s): ; gmailUsersGetProfile() -> Information about your account. ; gmailUsersLabelsList() -> Get all available labels ids. ex. "INBOX", "UNREAD" ; gmailUsersLabelsGet() -> Get information about specific label id. ; gmailUsersMessagesBatchDelete() -> Delete many messages emails by id. ; gmailUsersMessagesBatchModify() -> Set status for many messages ex. "INBOX", "UNREAD" ; gmailUsersMessagesDelete() -> Totaly delete email from ur account. ; gmailUsersMessagesGet() -> Get all information about specific email. ; gmailUsersMessagesList() -> Get list of last ~100 emails. ; gmailUsersMessagesModify() -> Modify single message. ; gmailUsersMessagesTrash() -> Put email in trash. ; gmailUsersMessagesUntrash() -> Restore email from trash. ; gmailUsersMessagesSend() -> Send email to single or group recipients. ; gmailUsersMessagesAttachmentsGet() -> Download attachment by id. ; ; Author(s): Ascer ;======================================================================================================================== 4. Downloads.
      oAuth.au3 Gmail API.au3 5. Examples.
      Sending emails
    • PoojaKrishna
      By PoojaKrishna
      Hi friends,
       
      I want to create a script than can read a gmail inbox to see content of mails from a particular address. I have searched a lot in the forum, there are so many topics related to this but I was not able to get a script that reads mail text. Can anyone please help?
    • unity06
      By unity06
      Hi Forum,
      I currently want to write a script that will download the emails from my gmail account and store them on my hard drive in form of text messages. Text file name will have date followed by title of the email and the email body will be the text body. Then I will write my scripts to monitor and inspect emails and post process the data.
      Anyone can suggest an easy way to achieve this?
      Maybe it has to be done indirectly via first having an email client that tracks my gmail account and downloads emails to hard drive such as Outlook?
      Will be very thankful for any suggestions on how to tackle this.
      Regards
    • lewisg
      By lewisg
      Any suggestions as to how to download, get, or retrieve email from Google's Gmail?  No need to send mail only receive. 
      I thought perhaps JiBE's SSL UDF might work however a reply to a post at his original post says otherwise (Didn't want to hijack his post).
      I have been using "GAM", "GYB", and "GMAIL Backup"(old), all command line inputs. Running them through a AutoIT script using RUN() and RUNWAIT() works somewhat, but has been unreliable.