Jump to content

Filling out my email in IE


Recommended Posts

Hey everyone,

I am have a ridiculous time trying to fill out my hotmail email within Internet Explorer. I dont want to use the SMPT rought and want to use my Hotmail login online to do so. I dont find the forms that I need to fill out, i.e. email subject field, email body text field and recipient email field. I dont have much experience with with all the IE stuff but have been working on it non stop for the past couple days. I dont know whether its because there is a frame surrounding the fields i want to fill or what. I look at the source but cant seem to find what I need.

Any guidance would be appreciated. All I wont to do is fill out my email with a recipients email address, put a subject in and write the email text then send. I never thought it would be this difficult for me.

Thanks in advance,

Mason

_IE_FillMyEmail($MyIEWindow)

Func _IE_FillMyEmail($oIE)
    _IEErrorNotify(False)
    $oForms = _IEFormGetCollection($oIE)
    $Index = 0
    For $oForm In $oForms
        $oFormElements = _IEFormElementGetCollection($oForm)
        If IsObj($oFormElements) Then
            dbg("IsObj($oFormElements) = true")
            dbg("Form Element Type: " & $oFormElements.type)
            $IndexElement = 0
            For $oElement In $oFormElements
                dbg("Element Type: " & $oElement.type)
                dbg("Element Name: " & $oElement.name)
                ;If I could find what im looking for I would put what to fill out here
            Next
        Else
            dbg("IsObj($oFormElements) = false")
        EndIf
        $Index += 1
    Next

EndFunc ;==>fill out my email
Edited by MasonMill
Link to comment
Share on other sites

This appears to work just fine:

#include <IE.au3>

Local $cUrl  = "https://login.live.com"
Local $cUser = "test@test.com"
Local $cPass = "testpass"

Local $oIE = _IECreate($cUrl, 1)

Local $oForm = _IEFormGetCollection($oIE, 0)
Local $oName = _IEFormElementGetObjByName($oForm, "login")
Local $oPass = _IEFormElementGetObjByName($oForm, "passwd")
Local $oButton = _IEFormElementGetObjByName($oForm, "idSIButton9")

_IEFormElementSetValue($oName, $cUser, 1)
_IEFormElementSetValue($oPass, $cPass, 1)

_IEAction($oButton, "click")
Link to comment
Share on other sites

 

This appears to work just fine:

#include <IE.au3>

Local $cUrl  = "https://login.live.com"
Local $cUser = "test@test.com"
Local $cPass = "testpass"

Local $oIE = _IECreate($cUrl, 1)

Local $oForm = _IEFormGetCollection($oIE, 0)
Local $oName = _IEFormElementGetObjByName($oForm, "login")
Local $oPass = _IEFormElementGetObjByName($oForm, "passwd")
Local $oButton = _IEFormElementGetObjByName($oForm, "idSIButton9")

_IEFormElementSetValue($oName, $cUser, 1)
_IEFormElementSetValue($oPass, $cPass, 1)

_IEAction($oButton, "click")

 

Yeah, I was able to get in ok with this:

Func _IEAutoLogin($sUrl, $sUsername, $sPwd)
    $oIE = _IECreate($sUrl)
    _IEErrorNotify(False)
    $oForms = _IEFormGetCollection($oIE)
    $Index = 0
    For $oForm In $oForms
        $oFormElements = _IEFormElementGetCollection($oForm)
        If IsObj($oFormElements) Then
            $IndexElement = 0
            For $oElement In $oFormElements
                Local $oDiv = _IEGetObjById($oIE, "line1")
                If $oElement.Type = 'password' Then
                    $oPwd = _IEFormElementGetObjByName($oForm, $oElement.Name)
                    _IEFormElementSetValue($oPwd, $sPwd)
                    For $i = $IndexElement - 1 To 0 Step -1
                        $oUser = _IEFormElementGetCollection($oForm, $i)
                        If $oUser.Type = 'text' Then
                            _IEFormElementSetValue($oUser, $sUsername)
                            ExitLoop
                        EndIf
                    Next
                    If $oForm.action <> "0" And Not StringInStr($oForm.action, '.php') Then  ;submit
                        _IEFormSubmit($oForm, 0)
                        _IELoadWait($oIE)
                    Else  ;click
                        For $i = $IndexElement + 1 To $IndexElement + 10 ;check the next 10 elements
                            $oButton = _IEFormElementGetCollection($oForm, $i)
                            If $oButton.Type = 'submit' Then
                                _IEAction($oButton, "click")
                                ExitLoop
                            EndIf
                        Next
                    EndIf
                EndIf
                $IndexElement += 1
            Next
        EndIf
        $Index += 1
    Next
    Return $oIE


EndFunc   ;==>_IEAutoLogin

 

The problem is once I'm logged in and looking at the compose email screen I can't find the forms. If they are actually form i need to be looking for. If you are logged in the address is https://bay175.mail.live.com/default.aspx#page=Compose

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

×
×
  • Create New...