Jump to content

Recommended Posts

Posted

Hello,

Is there any way to open My Email(Gmail) when i run .au3 file.

I can open firefox from this code

#include <Process.au3>

_RunDos("start firefox.exe")

but can i go further and give the .au3 file my username,password, and website(preferably Gmail)

and it automatically puts username and password in their respective fields and signs in.

Any help will be appreciated

Thanks

Posted

Hello,

Is there any way to open My Email(Gmail) when i run .au3 file.

I can open firefox from this code

#include <Process.au3>

_RunDos("start firefox.exe")

but can i go further and give the .au3 file my username,password, and website(preferably Gmail)

and it automatically puts username and password in their respective fields and signs in.

Any help will be appreciated

Thanks

#include <IE.au3>

OpenGMail("Username@gmail.com","Password")

Func OpenGMail($Username,$Password,$SW_HIDE = True)
Local $f_visible = 1
if ($SW_HIDE) Then $f_visible = 0
$oIE = _IECreate ("https://www.google.com/accounts/Login?continue=http%3A%2F%2Fmail.google.com%2Fmail%2Fe-11-45c5a24ad952518e594434fe9fa72-b639b2a33c4fdbc5ae45c3d03e2ef465df6cbadd&service=mail&type=2",0,$f_visible,1,1)
$UsernameInput = GetObj($oIE,"Input","Email","Text")
$PasswordInput = GetObj($oIE,"Input","Passwd","password")
$SignInInput = GetObj($oIE,"Input","signIn","submit")
if IsObj($UsernameInput) And IsObj($PasswordInput) And IsObj($SignInInput) Then
$UsernameInput.value = $Username
$PasswordInput.value = $Password
$SignInInput.Click()
_IEAction ($oIE,"visible")
Return SetError(0,0,True)
Else
Return SetError(1,0,False)
EndIf
EndFunc


Func GetObj($oIE,$tagName,$Name,$Type)
For $i = 0 To $oIE.document.all.length - 1
if StringUpper($oIE.document.all($i).tagName) == StringUpper($tagName) And _
StringUpper($oIE.document.all($i).Name) == StringUpper($Name) And _
StringUpper($oIE.document.all($i).type) == StringUpper($Type) Then _
Return SetError(0,0,$oIE.document.all($i))
Next
Return SetError(1,0,0)
EndFunc

صرح السماء كان هنا

 

Posted

#include <IE.au3>

OpenGMail("Username@gmail.com","Password")

Func OpenGMail($Username,$Password,$SW_HIDE = True)
Local $f_visible = 1
if ($SW_HIDE) Then $f_visible = 0
$oIE = _IECreate ("https://www.google.com/accounts/Login?continue=http%3A%2F%2Fmail.google.com%2Fmail%2Fe-11-45c5a24ad952518e594434fe9fa72-b639b2a33c4fdbc5ae45c3d03e2ef465df6cbadd&service=mail&type=2",0,$f_visible,1,1)
$UsernameInput = GetObj($oIE,"Input","Email","Text")
$PasswordInput = GetObj($oIE,"Input","Passwd","password")
$SignInInput = GetObj($oIE,"Input","signIn","submit")
if IsObj($UsernameInput) And IsObj($PasswordInput) And IsObj($SignInInput) Then
$UsernameInput.value = $Username
$PasswordInput.value = $Password
$SignInInput.Click()
_IEAction ($oIE,"visible")
Return SetError(0,0,True)
Else
Return SetError(1,0,False)
EndIf
EndFunc


Func GetObj($oIE,$tagName,$Name,$Type)
For $i = 0 To $oIE.document.all.length - 1
if StringUpper($oIE.document.all($i).tagName) == StringUpper($tagName) And _
StringUpper($oIE.document.all($i).Name) == StringUpper($Name) And _
StringUpper($oIE.document.all($i).type) == StringUpper($Type) Then _
Return SetError(0,0,$oIE.document.all($i))
Next
Return SetError(1,0,0)
EndFunc

Thanks :-)

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
×
×
  • Create New...