#include <IE.au3>
$sLogin = 'Login'
$sPass = 'Password'
$oIE = _IECreate('http://www.google.ru/')
If @error Then
MsgBox(16, 'Error', '_IECreate')
Exit
EndIf
For $i = 1 To 1
_IELinkClickByText($oIE, 'Gmail')
If @error Then ExitLoop
$oForm = _IEGetObjById($oIE, 'gaia_loginform')
If @error Then ExitLoop
$oLogin = _IEFormElementGetObjByName($oForm, 'Email')
If @error Then ExitLoop
$oPass = _IEFormElementGetObjByName($oForm, 'Passwd')
If @error Then ExitLoop
_IEFormElementSetValue($oLogin, $sLogin)
If @error Then ExitLoop
_IEFormElementSetValue($oPass, $sPass)
If @error Then ExitLoop
_IEFormElementCheckBoxSelect($oForm, 0, 'PersistentCookie', 1, 'byIndex')
If @error Then ExitLoop
_IEFormSubmit($oForm, 0)
If @error Then ExitLoop
_IELoadWait($oIE)
Next
If @error Then
MsgBox(16, 'Error', @error)
Else
MsgBox(64, 'Info', 'OK')
EndIf