Jump to content

Auto Email login bot with combo box list items


Recommended Posts

hi I'm trying to create a script to auto login to my email, I have a few different emails i want to pick from

can't seam to get the button that lunches the email website to change depending on what is selected in the combo box  here is the code I'm working with. Any help would be really appreciated.

thanks guys!

 

#RequireAdmin

#include <IE.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ComboConstants.au3>

AutoItSetOption ( "TrayIconDebug", 1 )



#Region ### START Koda GUI section ### Form=
$AutoEmail = GUICreate("Auto Email", 379, 300, 1524, 1035)

$Gmail = GUICtrlCreateButton("Gmail", 24, 16, 129, 41)
$Hotmail = GUICtrlCreateButton("Hotmail", 223, 16, 129, 41)


GUICtrlCreateCombo("", 24, 80, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))

GUICtrlSetData(-1, "UserName@gmail.com|userName2@gmail.com", "UserName@gmail.com")
$Gmail_boxitem1 = GUICtrlRead (1001)
$Gmail_boxitem2 = GUICtrlRead (1001)


GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit


        Case $Gmail_boxitem2
            gmail_login2 ()


        Case $Gmail_boxitem1
            gmail_login1 ()


        Case $Gmail
            gmail_login1 ()



        Case $Hotmail
            hotmail_login ()

    EndSwitch
WEnd


Call ("gmail_login1")


Func gmail_login1 ()
    Global $oIE =_IECreate ("http://www.gmail.com")
    local $username = _IEGetObjByName ($oIE, "Email")
    Local $password = _IEGetObjByName ($oIE, "Passwd")
    Local $button = _IEGetObjByName ($oIE,"signIn")

    _IEFormElementSetValue ($username, "username@gmail.com")
    _IEFormElementSetValue ($password, "Your Password")
    _IEAction ($button, "click")

EndFunc


Func gmail_login2 ()
    Global $oIE =_IECreate ("http://www.gmail.com")
    ;local $username = _IEGetObjByName ($oIE, "Email")
    Local $password = _IEGetObjByName ($oIE, "Passwd")
    Local $button = _IEGetObjByName ($oIE,"account-name")
    Local $button = _IEGetObjByName ($oIE,"signIn")

    ;_IEFormElementSetValue ($username, "UserName@gmail.com")
    _IEFormElementSetValue ($password, "Your Password")
    _IEAction ($button, "click")

EndFunc


Call ("hotmail_login")

Func hotmail_login ()

    Global $oIE =_IECreate ("http://www.live.com")
    local $username = _IEGetObjByName ($oIE, "login")
    Local $password = _IEGetObjByName ($oIE, "passwd")
    Local $button = _IEGetObjByName ($oIE,"SI")

    _IEFormElementSetValue ($username, "UserName@hotmail.com")
    _IEFormElementSetValue ($password, "Your Password")
    _IEAction ($button, "click")

EndFunc
Edited by iresolver
Link to comment
Share on other sites

  • Moderators

iresolver,

Just read the combo when you press the button: :)

#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <ComboConstants.au3>

$AutoEmail = GUICreate("Auto Email", 379, 300)

$Gmail = GUICtrlCreateButton("Gmail", 24, 16, 129, 41)
$Hotmail = GUICtrlCreateButton("Hotmail", 223, 16, 129, 41)

$cCombo = GUICtrlCreateCombo("", 24, 80, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData($cCombo, "UserName@gmail.com|userName2@gmail.com", "UserName@gmail.com")

GUISetState(@SW_SHOW)

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Gmail
            Switch GUICtrlRead($cCombo)
                Case "UserName@gmail.com"
                    gmail_login1()
                Case "UserName2@gmail.com"
                    gmail_login2()
            EndSwitch

        Case $Hotmail
            hotmail_login ()

    EndSwitch
WEnd

Func gmail_login1 ()
    MsgBox($MB_SYSTEMMODAL, "Login", "gmail_login1")
EndFunc

Func gmail_login2 ()
    MsgBox($MB_SYSTEMMODAL, "Login", "gmail_login2")
EndFunc

Func hotmail_login ()
    MsgBox($MB_SYSTEMMODAL, "Login", "hotmail")
EndFunc
All clear? :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

thanks so much your script helped me, I finally got it to work!!!

your the best!!! 

I will post the script after I take out my user name & passwords so others can auto login to there email as well

thanks again Melba23 could not have done it without you :)

Link to comment
Share on other sites

Many ways to skin a cat :) 

Here is my spin. It's very similar although - I slimmed it down a little to use one function and pass parameters used to decide what account and email to use. 

#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <ComboConstants.au3>

$AutoEmail = GUICreate("Auto Email", 379, 300, 1524, 1035)
$emailLogin = GUICtrlCreateButton("Login", 24, 16, 129, 41)

$cCombo = GUICtrlCreateCombo("", 24, 80, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))  ; assigned your combo to a variable I can refer to
GUICtrlSetData(-1, "UserName@gmail.com|userName2@gmail.com|userName@hotmail.com|userName2@hotmail.com", "UserName@gmail.com")

GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
            Case $emailLogin
            $MySele = GUICtrlRead($cCombo)
            Switch $MySele
                Case StringInStr($MySele, "gmail") > 0
                    _email_login($MySele,"gmail")
                Case StringInStr($MySele, "hotmail") > 0
                    _email_login($MySele,"hotmail")
            EndSwitch
    EndSwitch
WEnd

Func _email_login ($sComboSelectedItem,$emailType)
    Switch $emailType
        Case "gmail"
            ;gmail specific stuff here
             MsgBox($MB_SYSTEMMODAL, "Login", "Type: " & $emailType & @CRLF & "Email: " & $sComboSelectedItem)
        Case "hotmail"
            ;hotmail specific stuff here
             MsgBox($MB_SYSTEMMODAL, "Login", "Type: " & $emailType & @CRLF & "Email: " & $sComboSelectedItem)
    EndSwitch
EndFunc
Link to comment
Share on other sites

This is what I have it works but the gmail & hotmail send buttons don't open the websites all the time you have to keep clicking them a few times I think the loops are not working the way they should

if anyone has any ideas I would love to hear them

thanks guys

#RequireAdmin
#include <IE.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ComboConstants.au3>
#include <Array.au3>
AutoItSetOption ( "TrayIconDebug", 1 )

#cs---------------------------------------  Auto Multi Email login  -----------------------------------------
;                                  _______
;    /\           _____  _____    |          _      _                   |      ______   _____
;   /  \   |    |   |   |     |   |____     | \    / |   /\   o |       |     |      | |       o |\  |
;  /----\  |    |   |   |     |   |      -- |  \  /  |  /--\  | |       |     |      | |  _ _  | | \ |
; /      \ |____|   |   |_____|   |_______  |   \/   | /    \ | |____   |____ |______| |_____| | |  \|
;
#ce----------------------------------------------------------------------------------------------------------



;--------------------  this is the GUI  ------------------------------------------------
$AutoEmail = GUICreate("Auto Email", 339, 125, @DesktopWidth, @DesktopHeight)
$aTaskbar = WinGetPos("[CLASS:Shell_TrayWnd]", "")
$aWin = WinGetPos($AutoEmail)
WinMove($AutoEmail, "", @DesktopWidth - $aWin[2] - 4, @DesktopHeight - $aWin[3] - $aTaskbar[3] - 4)

$Gmail = GUICtrlCreateButton("Gmail", 64, 16, 49, 41, $BS_ICON)
GUICtrlSetImage(-1, "C:\Users\iresolver\Downloads\gmail_icon.ico", 1)

$Hotmail = GUICtrlCreateButton("Hotmail", 223, 16, 49, 41, $BS_ICON)
GUICtrlSetImage(-1, "C:\Users\iresolver\Downloads\MSMail_icon.ico", 1)

$cCombo = GUICtrlCreateCombo("", 16, 72, 145, 25)
GUICtrlSetData(-1, "YourAccount1@gmail.com|YourAccount2@gmail.com", "YourAccount1@gmail.com")

$cCombo2 = GUICtrlCreateCombo("", 176, 72, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "YourAccount1@hotmail.com|YourAccount2@hotmail.com", "YourAccount1@hotmail.com")

GUISetState(@SW_SHOW)
;--------------------  End of GUI  ------------------------------------------------------


While 1
If $Gmail Then Gmail ()
If $Hotmail Then Hotmail ()
WEnd


Func Gmail ()
Switch GUIGetMsg ()
        Case $GUI_EVENT_CLOSE
        Exit
        Case $Gmail
            Switch GUICtrlRead($cCombo)
        Case "YourAccount1@gmail.com"          ;change this to your G-Mail Account 1
                    gmail_Account1 ()          ;Don't change this line

        Case "YourAccount2@gmail.com"          ;change this to your G-Mail Account 2
                    gmail_Account2 ()          ;Don't change this line
            EndSwitch
            EndSwitch
EndFunc

Func Hotmail ()
    Switch GUIGetMsg ()
        Case $GUI_EVENT_CLOSE
        Exit

        Case $Hotmail
        Switch GUICtrlRead($cCombo2)

        Case "YourAccount1@hotmail.com"              ;change this to your Hotmail Account 1
                    Hotmail_Account1 ()              ;Don't change this

        Case "YourAccount2@hotmail.com"              ;change this to your Hotmail Account 2
                    Hotmail_Account2 ()              ;Don't change this line
     EndSwitch
     EndSwitch

EndFunc

Func gmail_Account1 ()

Global $oIE =_IECreate ("https://accounts.google.com/ServiceLogin?sacu=1&continue=http%3A%2F%2Fmail.google.com%2Fmail%2F%3Fpc%3Dtopnav-about-en&hl=en&service=mail")

    local $username = _IEGetObjByName ($oIE, "Email")
    Local $password = _IEGetObjByName ($oIE, "Passwd")

    Local $Email_button = _IEGetObjByName ($oIE, "Email")
    Local $Signin_button = _IEGetObjByName ($oIE,"signIn")

    _IEFormElementSetValue ($username, "YourAccount1@gmail.com")        ;change this to your Gmail Account 1 Name
    _IEFormElementSetValue ($password, "Your Password")                 ;change this to your Gmail Account 1 Password

    _IEAction ($Email_button, "click")
    _IEAction ($Signin_button, "click")

EndFunc


Func gmail_Account2 ()

Global $oIE =_IECreate ("https://accounts.google.com/ServiceLogin?sacu=1&continue=http%3A%2F%2Fmail.google.com%2Fmail%2F%3Fpc%3Dtopnav-about-en&hl=en&service=mail")

    local $username = _IEGetObjByName ($oIE, "Email")
    Local $password = _IEGetObjByName ($oIE, "Passwd")

    Local $Email_button = _IEGetObjByName ($oIE, "account-email")
    Local $Signin_button = _IEGetObjByName ($oIE,"signIn")

    _IEFormElementSetValue ($username, "YourAccount2@gmail.com")          ;change this to your Gmail Account 2 Name
    _IEFormElementSetValue ($password, "Your Password")                   ;change this to your Gmail Account 2 Password

    _IEAction ($Email_button, "click")
    _IEAction ($Signin_button, "click")

EndFunc


Func hotmail_Account1 ()

Global $oIE =_IECreate ("http://www.live.com")

    local $username = _IEGetObjByName ($oIE, "login")
    Local $password = _IEGetObjByName ($oIE, "passwd")
    Local $Signin_button = _IEGetObjByName ($oIE,"SI")

    _IEFormElementSetValue ($username, "YourAccount1@hotmail.com")         ;change this to your Hotmail Account 1 Name
    _IEFormElementSetValue ($password, "Your Password")                    ;change this to your Hotmail Account 1 Password
    _IEAction ($Signin_button, "click")

EndFunc


Func hotmail_Account2 ()

Global $oIE =_IECreate ("http://www.live.com")

    local $username = _IEGetObjByName ($oIE, "login")
    Local $password = _IEGetObjByName ($oIE, "passwd")
    Local $Signin_button = _IEGetObjByName ($oIE,"SI")

    _IEFormElementSetValue ($username, "YourAccount2@hotmail.com")         ;change this to your Hotmail Account 2 Name
    _IEFormElementSetValue ($password, "Your Password")                    ;change this to your Hotmail Account 2 Password
    _IEAction ($Signin_button, "click")

EndFunc
Link to comment
Share on other sites

You might want to put a Sleep(100) in your While loop, and see if that helps with getting the button presses.

Edit

Add these and see if it helps

Global $msg
#include <GUIConstantsEx.au3>

While 1
    $msg = GUIGetMsg()
If $msg = $Gmail Then Gmail ()

If $msg = $Hotmail Then Hotmail ()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop

WEnd

GUIDelete($AutoEmail)

.

Edited by nitekram

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Link to comment
Share on other sites

  • Moderators

iresolver,

Just expand the code I gave you using a second combo which you read when you press the second button. Give it a try and see if you can get it to work - you know where we are if you run into problems. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

iresolver,

That looks nothing like the code I posted above - and is syntactic garbage. This is going to sound harsh, but if you want help here YOU have to make some effort to learn how to code. Think of the old saying: "Give a man a fish, you feed him for a day; give a man a net and you feed him forever" - we try to be net makers and repairers, not fishmongers. ;)

So look at what I posted above:

; Start an infinite loop
While 1
    ; If a control is actioned
    Switch GUIGetMsg()
        ; It was the exit [X]
        Case $GUI_EVENT_CLOSE
            ; So exit
            Exit
        ; It was the GMail button
        Case $Gmail
            ; So read the GMail combo
            Switch GUICtrlRead($cCombo)
                ; And act according to the setting
                Case "UserName@gmail.com"
                    gmail_login1()
                Case "UserName2@gmail.com"
                    gmail_login2()
            EndSwitch
        ; It was the Hotmail button
        Case $Hotmail
            hotmail_login ()
    EndSwitch
    ; And wait until the next event
WEnd
as I explained above, you will need to create a second combo (with its ControlID saved a different variable) and read this combo when the "Hotmail" button is pressed, in exactly the same way as in the existing "Gmail" Case. :)

Is that clearer? :huh:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

I do have two different combos Switch GUICtrlRead($cCombo) Switch GUICtrlRead($cCombo2) and there also declared at the top of my script

sorry about my syntactics I have only been doing Autoit for about a week now

again my code works just not reliably it seams to be the while 1 loop

can't get it to pause until I pick the gmail button or Hotmail button here is my latest script

#RequireAdmin
#include <IE.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ComboConstants.au3>
#include <Array.au3>
AutoItSetOption ( "TrayIconDebug", 1 )

#cs---------------------------------------  Auto Multi Email login  -----------------------------------------
;                                  _______
;    /\           _____  _____    |          _      _                   |      ______   _____
;   /  \   |    |   |   |     |   |____     | \    / |   /\   o |       |     |      | |       o |\  |
;  /----\  |    |   |   |     |   |      -- |  \  /  |  /--\  | |       |     |      | |  _ _  | | \ |
; /      \ |____|   |   |_____|   |_______  |   \/   | /    \ | |____   |____ |______| |_____| | |  \|
;
#ce----------------------------------------------------------------------------------------------------------



;--------------------  this is the GUI  ------------------------------------------------
$AutoEmail = GUICreate("Auto Email", 339, 125, @DesktopWidth, @DesktopHeight)
$aTaskbar = WinGetPos("[CLASS:Shell_TrayWnd]", "")
$aWin = WinGetPos($AutoEmail)
WinMove($AutoEmail, "", @DesktopWidth - $aWin[2] - 4, @DesktopHeight - $aWin[3] - $aTaskbar[3] - 4)

Global $Gmail = GUICtrlCreateButton("Gmail", 64, 16, 49, 41, $BS_ICON)
GUICtrlSetImage(-1, "C:\Users\iresolver\Downloads\gmail_icon.ico", 1)

Global $Hotmail = GUICtrlCreateButton("Hotmail", 223, 16, 49, 41, $BS_ICON)
GUICtrlSetImage(-1, "C:\Users\iresolver\Downloads\MSMail_icon.ico", 1)

Global $cCombo = GUICtrlCreateCombo("", 16, 72, 145, 25)
GUICtrlSetData(-1, "YourAccount1@gmail.com|YourAccount2@gmail.com", "YourAccount1@gmail.com")

Global $cCombo2 = GUICtrlCreateCombo("", 176, 72, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "YourAccount1@hotmail.com|YourAccount2@hotmail.com", "YourAccount1@hotmail.com")

Global $msg
GUISetState(@SW_SHOW)
;--------------------  End of GUI  ------------------------------------------------------


While 1
If $Gmail Then Gmail()
Sleep (100)
If $Hotmail Then Hotmail()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd


Func Gmail()
Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
        Exit
        Case $Gmail
            Switch GUICtrlRead($cCombo)
        Case "YourAccount1@gmail.com"          ;change this to your G-Mail Account 1
                    gmail_Account1()           ;Don't change this line

        Case "YourAccount2@gmail.com"          ;change this to your G-Mail Account 2
                    gmail_Account2()                   ;Don't change this line
EndSwitch
EndSwitch

EndFunc

Func Hotmail()
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
        Exit

        Case $Hotmail
        Switch GUICtrlRead($cCombo2)

        Case "YourAccount1@hotmail.com"              ;change this to your Hotmail Account 1
                    Hotmail_Account1()              ;Don't change this

        Case "YourAccount2@hotmail.com"              ;change this to your Hotmail Account 2
                    Hotmail_Account2()              ;Don't change this line
EndSwitch
EndSwitch

EndFunc

Func gmail_Account1()

Global $oIE =_IECreate ("https://accounts.google.com/ServiceLogin?sacu=1&continue=http%3A%2F%2Fmail.google.com%2Fmail%2F%3Fpc%3Dtopnav-about-en&hl=en&service=mail")

    local $username = _IEGetObjByName ($oIE, "Email")
    Local $password = _IEGetObjByName ($oIE, "Passwd")

    Local $Email_button = _IEGetObjByName ($oIE, "Email")
    Local $Signin_button = _IEGetObjByName ($oIE,"signIn")

    _IEFormElementSetValue ($username, "YourAccount1@gmail.com")        ;change this to your Gmail Account 1 Name
    _IEFormElementSetValue ($password, "Your Password")                 ;change this to your Gmail Account 1 Password

    _IEAction ($Email_button, "click")
    _IEAction ($Signin_button, "click")

EndFunc


Func gmail_Account2()

Global $oIE =_IECreate ("https://accounts.google.com/ServiceLogin?sacu=1&continue=http%3A%2F%2Fmail.google.com%2Fmail%2F%3Fpc%3Dtopnav-about-en&hl=en&service=mail")

    local $username = _IEGetObjByName ($oIE, "Email")
    Local $password = _IEGetObjByName ($oIE, "Passwd")

    Local $Email_button = _IEGetObjByName ($oIE, "account-email")
    Local $Signin_button = _IEGetObjByName ($oIE,"signIn")

    _IEFormElementSetValue ($username, "YourAccount2@gmail.com")          ;change this to your Gmail Account 2 Name
    _IEFormElementSetValue ($password, "Your Password")                   ;change this to your Gmail Account 2 Password

    _IEAction ($Email_button, "click")
    _IEAction ($Signin_button, "click")

EndFunc


Func hotmail_Account1()

Global $oIE =_IECreate ("http://www.live.com")

    local $username = _IEGetObjByName ($oIE, "login")
    Local $password = _IEGetObjByName ($oIE, "passwd")
    Local $Signin_button = _IEGetObjByName ($oIE,"SI")

    _IEFormElementSetValue ($username, "YourAccount1@hotmail.com")         ;change this to your Hotmail Account 1 Name
    _IEFormElementSetValue ($password, "Your Password")                    ;change this to your Hotmail Account 1 Password
    _IEAction ($Signin_button, "click")

EndFunc


Func hotmail_Account2()

Global $oIE =_IECreate ("http://www.live.com")

    local $username = _IEGetObjByName ($oIE, "login")
    Local $password = _IEGetObjByName ($oIE, "passwd")
    Local $Signin_button = _IEGetObjByName ($oIE,"SI")

    _IEFormElementSetValue ($username, "YourAccount2@hotmail.com")         ;change this to your Hotmail Account 2 Name
    _IEFormElementSetValue ($password, "Your Password")                    ;change this to your Hotmail Account 2 Password
    _IEAction ($Signin_button, "click")

EndFunc
Edited by iresolver
Link to comment
Share on other sites

ok your right I put that loop you made on my original script and connected the other two hotmail accounts it all works perfectly now

thank you so much 

sorry I was flip flopping between scripts trying to get it to work

I was trying jakejohnson74 script as well  and getting confused.

should have stayed with my original script!

 

I will post the new working script without my accounts Soon so others can enjoy!

thanks again Melba23 you know your stuff :)

Link to comment
Share on other sites

  • Moderators

iresolver,

 

sorry about my syntactics I have only been doing Autoit for about a week now

No problem - we all started at that point. :D

As to your script - close, but no cigar. See if you can see why this does work: ;)

;#RequireAdmin
#include <IE.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ComboConstants.au3>
#include <Array.au3>
;AutoItSetOption ( "TrayIconDebug", 1 )

$AutoEmail = GUICreate("Auto Email", 339, 125)
$aTaskbar = WinGetPos("[CLASS:Shell_TrayWnd]", "")
$aWin = WinGetPos($AutoEmail)
WinMove($AutoEmail, "", @DesktopWidth - $aWin[2] - 4, @DesktopHeight - $aWin[3] - $aTaskbar[3] - 4)

Global $Gmail = GUICtrlCreateButton("Gmail", 64, 16, 49, 41, $BS_ICON)
;GUICtrlSetImage(-1, "C:\Users\iresolver\Downloads\gmail_icon.ico", 1)

Global $Hotmail = GUICtrlCreateButton("Hotmail", 223, 16, 49, 41, $BS_ICON)
;GUICtrlSetImage(-1, "C:\Users\iresolver\Downloads\MSMail_icon.ico", 1)

Global $cCombo = GUICtrlCreateCombo("", 16, 72, 145, 25)
GUICtrlSetData(-1, "YourAccount1@gmail.com|YourAccount2@gmail.com", "YourAccount1@gmail.com")

Global $cCombo2 = GUICtrlCreateCombo("", 176, 72, 145, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "YourAccount1@hotmail.com|YourAccount2@hotmail.com", "YourAccount1@hotmail.com")

GUISetState(@SW_SHOW)

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Gmail
            Switch GUICtrlRead($cCombo)
                Case "YourAccount1@gmail.com"
                    gmail_Account1()
                Case "YourAccount2@gmail.com"
                    gmail_Account2()
            EndSwitch
        Case $Hotmail
            Switch GUICtrlRead($cCombo2)
                Case "YourAccount1@hotmail.com"
                    hotmail_Account1()
                Case "YourAccount2@hotmail.com"
                    hotmail_Account2()
            EndSwitch
    EndSwitch

WEnd

Func gmail_Account1()
    MsgBox($MB_SYSTEMMODAL, "Open", "GMail 1")
EndFunc   ;==>gmail_Account1


Func gmail_Account2()
    MsgBox($MB_SYSTEMMODAL, "Open", "GMail 2")
EndFunc   ;==>gmail_Account2


Func hotmail_Account1()
    MsgBox($MB_SYSTEMMODAL, "Open", "HotMail 1")
EndFunc   ;==>hotmail_Account1


Func hotmail_Account2()
    MsgBox($MB_SYSTEMMODAL, "Open", "HotMail 2")
EndFunc   ;==>hotmail_Account2
Please do ask if you have any questions. :)

M23

Edit: I see you got there on your own - excellent! :thumbsup:

Second edit: Something went wrong and several instances of our last posts were showing - I have tidied up the thread a bit and all seems well now. :wacko:

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Here it is the Auto Email login app with GUI

This is what it looks like

screen_cap.png

Melba23 helped me to get this working!!

Thanks again Melba23

Here is the code

#RequireAdmin
#include <IE.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ComboConstants.au3>

AutoItSetOption ( "TrayIconDebug", 1 )



#cs=======================================  Auto Multi Email login  =========================================================
;         __             ____             _______                                     __                                     |
;        //\\    __   __|----|  _____    ||------    __      __     __       __       ||      ______   _____       __   __   |
;       //  \\   ||   ||  ||   ||---||   ||____     ||\\    //||   //\\   O  ||       ||     ||----|| ||----   O  ||\\  ||   |
;      //____\\  ||   ||  ||   ||   ||   ||----  -- || \\  // ||  //--\\  || ||       ||     ||    || ||  ___  || || \\ ||   |
;     //      \\ ||___||  ||   ||___||   ||_______  ||  \\//  || //    \\ || ||____   ||____ ||____|| ||____|| || ||  \\||   |
;    --       --  -----   --    -----    ---------  --   --   -- -      - --  -----   ------  ------  -------- -- --   ---   |
#ce==========================================================================================================================



;----------------Create a Folder & Put your icons files in the install dir first before you compile your EXE -----------------
DirCreate ("C:\Program Files\AutoEmail\")
FileInstall("C:\Program Files\AutoEmail\gmail_icon.ico", "C:\Program Files\AutoEmail\gmail_icon.ico")
FileInstall("C:\Program Files\AutoEmail\MSMail_icon.ico", "C:\Program Files\AutoEmail\MSMail_icon.ico")
;-----------------------------------------------------------------------------------------------------------------------------


;----------------------------------------- This is the GUI -------------------------------------------------------------------

$AutoEmail = GUICreate("Auto Email", 339, 125, @DesktopWidth, @DesktopHeight)
$aTaskbar = WinGetPos("[CLASS:Shell_TrayWnd]", "")
$aWin = WinGetPos($AutoEmail)
WinMove($AutoEmail, "", @DesktopWidth - $aWin[2] - 4, @DesktopHeight - $aWin[3] - $aTaskbar[3] - 4)

$Gmail = GUICtrlCreateButton("Gmail", 64, 16, 49, 41, $BS_ICON)
GUICtrlSetImage(-1, "C:\Program Files\AutoEmail\gmail_icon.ico", 1)

$Hotmail = GUICtrlCreateButton("Hotmail", 223, 16, 49, 41, $BS_ICON)
GUICtrlSetImage(-1, "C:\Program Files\AutoEmail\MSMail_icon.ico", 1)

$cCombo = GUICtrlCreateCombo("", 16, 72, 145, 25)
GUICtrlSetData(-1, "YourAccount1@gmail.com|YourAccount2@gmail.com", "YourAccount1@gmail.com")

$cCombo2 = GUICtrlCreateCombo("", 176, 72, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "YourAccount1@hotmail.com|YourAccount2@hotmail.com", "YourAccount1@hotmail.com")

Global $msg
GUISetState(@SW_SHOW)

;------------------------------------------- End of GUI -----------------------------------------------------------------------




;--------------------------------------- This is the loop ---------------------------------------------------------------------
While 1

    Switch GUIGetMsg()

        Case $GUI_EVENT_CLOSE
Exit

    Case $Gmail
        Switch GUICtrlRead($cCombo)
        Case "YourAccount1@gmail.com"          ;<=====   Here you put your Gmail Account Name
                    gmail_login1()
        Case "YourAccount2@gmail.com"          ;<=====   Here you put your 2nd Gmail Account Name
                    gmail_login2()
EndSwitch

    Case $Hotmail
        Switch GUICtrlRead($cCombo2)
        Case "YourAccount1@hotmail.com"        ;<=====   Here you put your Hotmail Account Name
                  hotmail_login1()
        Case "YourAccount2@hotmail.com"        ;<=====   Here you put your 2nd Hotmail Account Name
                  hotmail_login2()
EndSwitch

EndSwitch
WEnd





;---------------------------------------------------- This Reades what Email is selected in the combo box ------------------------------------------------------
Func Gmail()

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
Exit
        Case $Gmail
            Switch GUICtrlRead($cCombo)

        Case "YourAccount1@gmail.com"      ;<=====   Here you put your Gmail Account Name
                    gmail_login1()

        Case "YourAccount2@gmail.com"      ;<=====   Here you put your 2nd Gmail Account Name
                    gmail_login2()
EndSwitch
EndSwitch

EndFunc


Func Hotmail()

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
Exit

        Case $Hotmail
        Switch GUICtrlRead($cCombo2)

        Case "YourAccount1@hotmail.com"      ;<=====   Here you put your Hotmail Account Name
                    Hotmail_login1()

        Case "YourAccount2@hotmail.com"      ;<=====   Here you put your 2nd Hotmail Account Name
                    Hotmail_login2()
EndSwitch
EndSwitch

EndFunc

;----------------------------------------------------- This sends account info to web Browser & Logs in ------------------------------------------------------------
Func gmail_login1()
Sleep (60)

Global $oIE =_IECreate ("https://accounts.google.com/ServiceLogin?sacu=1&continue=http%3A%2F%2Fmail.google.com%2Fmail%2F%3Fpc%3Dtopnav-about-en&hl=en&service=mail")

    local $username = _IEGetObjByName ($oIE, "Email")
    Local $password = _IEGetObjByName ($oIE, "Passwd")

    Local $Email_button = _IEGetObjByName ($oIE, "Email")
    Local $Signin_button = _IEGetObjByName ($oIE,"signIn")

    _IEFormElementSetValue ($username, "YourAccount1@gmail.com")      ;<=====   Here you put your Gmail Account Name
    _IEFormElementSetValue ($password, "Your Password")               ;<=====   Here you put your Gmail Account Password

    _IEAction ($Email_button, "click")
    _IEAction ($Signin_button, "click")

EndFunc


Func gmail_login2()
Sleep(60)

Global $oIE =_IECreate ("https://accounts.google.com/ServiceLogin?sacu=1&continue=http%3A%2F%2Fmail.google.com%2Fmail%2F%3Fpc%3Dtopnav-about-en&hl=en&service=mail")

    local $username = _IEGetObjByName ($oIE, "Email")
    Local $password = _IEGetObjByName ($oIE, "Passwd")

    Local $Email_button = _IEGetObjByName ($oIE, "account-email")
    Local $Signin_button = _IEGetObjByName ($oIE,"signIn")

    _IEFormElementSetValue ($username, "YourAccount2@gmail.com")     ;<=====   Here you put your 2nd Gmail Account Name
    _IEFormElementSetValue ($password, "Your Password")              ;<=====   Here you put your 2nd Gmail Account Password

    _IEAction ($Email_button, "click")
    _IEAction ($Signin_button, "click")

EndFunc


Func hotmail_login1()
Sleep(60)

Global $oIE =_IECreate ("http://www.live.com")

    local $username = _IEGetObjByName ($oIE, "login")
    Local $password = _IEGetObjByName ($oIE, "passwd")
    Local $Signin_button = _IEGetObjByName ($oIE,"SI")

    _IEFormElementSetValue ($username, "YourAccount1@hotmail.com")    ;<=====   Here you put your Hotmail Account Name
    _IEFormElementSetValue ($password, "Your Password")               ;<=====   Here you put your Hotmail Account Password
    _IEAction ($Signin_button, "click")

EndFunc


Func hotmail_login2()
Sleep(60)

Global $oIE =_IECreate ("http://www.live.com")

    local $username = _IEGetObjByName ($oIE, "login")
    Local $password = _IEGetObjByName ($oIE, "passwd")
    Local $Signin_button = _IEGetObjByName ($oIE,"SI")

    _IEFormElementSetValue ($username, "YourAccount2@hotmail.com")    ;<=====   Here you put your Hotmail Account Name
    _IEFormElementSetValue ($password, "Your Password")               ;<=====   Here you put your Hotmail Account Password
    _IEAction ($Signin_button, "click")

EndFunc

AutoEmail_Login.au3

AutoEmail_EXE ICO.ico

gmail_icon.ico

MSMail_icon.ico

Edited by iresolver
Link to comment
Share on other sites

I would have liked to upload more files for this project but I can't attach them in the forum

So I will upload the full project to kickass torrents & thepiratebay soon, look for it there!

if anyone would like to add more features to this script feel free!

 

here is the link to the Torrent on Kickass.to

https://kickass.to/auto-login-to-gmail-hotmail-app-t10459908.html

My_THE_SHADOW_Small.png

Created By

The Shadow iTGuy

The iTGuy Knows...Ha,HA,HA

Edited by iresolver
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...