DaleHohm

Ie.au3 T2.0 Internet Explorer Automation Library

253 posts in this topic

#1 ·  Posted (edited)

Update 7/11/06: IE.au3 is now part of the standard UDF library as of beta 129 (3.1.1.129)!! T2.0-5 or higher of the Internet Explorer Automation Library (and documentation in the standard helpfile) will be installed when you install the latest beta. From this point forward, betas with new fixes or functionality will be made available in the forum for testing, but the primary release mechanism will be through the standard AutoIt distribution. When the production release of AutoIt is released, this library version will be changed to V2.1-x.

To obtain IE.au3, Download the latest AutoIt beta

Important: With the T2.0-4 release, the T1.0 functions that were included for compatibility have been moved out to a separate file. You may run scripts written for T1.0 by #include-ing this file in your scripts along with the T2.0 library:

Right-click and Save As... IE_V1Compatibility_T2.0_4.au3 (typically C:\Program Files\AutoIt3\beta\Include\IE_V1Compatibility.au3)

Helpfile documentation can still be discussed in the T2.0 Documentation post, but it is now included in the standard AutoIt beta helpfile.

See the Update History below for changes.

T2.0-5 contains only a couple of fixes and enhancements. See update history below.

T2.0-4 is mostly bug fixes with minor enhancements and new features. Consider it a strong release candidate.

T2.0-3 implements COM error trapping and should eliminate the readyState errors seen occasionally once and for all. For this to work it is critical that you use _IEErrorHandlerRegister("your-error-func") if you use a custom COM error handler however! Also note that _IEErrorHandlerRegister() without a parameter will instantiate a nice COM error handler for you that will trap COM errors, write diagnostic output to the SciTe console and return @error of $_IEStatus_ComError

T2.0-2 was pulled because of some bungles in _IEFrameGetObjByName() and _IEFormElementGetObjByName() [thanks to those that helped by reporting those errors and helping to diagnose]

I want to highlight several new features in T2.0-1 added to enhance usability:

  • IE.au3 now writes information to the console about all errors and warnings. e.g.

    --> IE.au3 Warning from function _IEFormGetObjByName, $_IEStatus_NoMatch

    --> IE.au3 Error from function _IEFormElementGetObjByName, $_IEStatus_InvalidDataType

  • It also traps of as many errors as possible (particularly COM errors) to avoid abrupt script termination (actually I should say that it anticipates, avoids and warns rather than traps).
  • _IEErrorHandlerRegister() allows you to trap COM errors with either your own routine or by using a standard internal routine (recommended). Several global string are set by the standard handler with information about the error (including a convenient $IEComErrorOutput string that summarizes the information).
These features should make debugging IE.au3 scripts much easier.

==================================================================

The previous baselevel remains available (in case I really mucked things up)

Right-click and Save As... IE_T2.0_4.au3 (requires AutoIt beta)

Note: Please see the end of this base-note for a list of verified issues with this test release that I am already working on...

This UDF allows you to either create or attach to an IE browser (either visible or invisible) and do just about anything you could do with it interactively with the mouse and keyboard, but do it through script. You can navigate to pages, click links, fill and submit forms etc. You can also do things you cannot do interactively like change or rewrite page content and javascripts (your in-memory copy, not back on the server) to enhance functionality or appearance. The ability to write content to the browser and respond to browser events also allows you to create hybrid AutoIt/Browser-based local applications.

There is a series of examples for V1 of the script that you can look through to get a flavor. There are 31 pages of replies to that post and a search of V3 Support for IE.au3 will net you a lot more.

We are working to get this added to the core UDF set for the next release of AutoIt. If we are confident that it has gotten exercised and the bugs squashed in time it will go in. With over 6000 downloads of the prior version, I hope that we can beat this up quickly and get a solid release ready to go.

This release contains many new features and I believe fixes the seldom seen, but annoying bugs from the previous version. I have restructured much of the code to make it more readable and have cleaned up the function naming consistency.

Please exercise it and report bugs, comments and suggestions about the code and functionality to this thread. Please submit your documentation suggestions to the documentation thread .

I tried to capture all of the significant requests and suggestions that I received. If I told you "it'll be in the next release" and it isn't, please keep me honest. It may not make this release, but I'll get it back on the ToDo list.

Enjoy,

Dale

Actions Required For Old Scripts

With this test release, all of your old scripts should work without modification ONLY if you download and include the IE_V1Compatibility_T2.0_4.au3 file, save it to your beta\include folder and include it in your scripts along with the T2.0-4 release of IE.au3 or later.

Update History

T2.0-5 7/3/06

Fixes

  • _IETagNameGetCollection() and _IETagNameAllGetCollection() unnecessarily converted the object passed into a document object.
Enhancements
  • Function headers in code updated and much more accurate
New Features
  • None
T2.0-4 6/26/06

Fixes

  • _IEFrameGetObjByName() now returns NoMatch when name does not match an existing Frame or iFrame
  • _IECreate() with takeFocus set to False returned an erroneous warning
  • _IEImgGetCollection() fixed major problems (used link collection instead of img collection)
  • _IEFormElementOptionselect() fixed fireEvent processing and index value datatype handling
  • _IEFormElementCheckboxSelect() fixed errors with fireEvent
  • _IEFormElementRadioSelect() fixed errors with fireEvent
  • _IEFormSubmit() fixed opportunity for object error
  • Replaced two internal references to _IEGetProperty with _IEPropertyGet
Enhanced Functions
  • _IELoadWait() further enhanced to trap more "Access is denied" errors - these are not transient
  • _IEPropertyGet($o_object, "locationurl") now works with any DOM object
  • _IEFormElementOptionselect() returns InvalidValue error when $f_select=0 unless type=select multiple
  • _IEAction() added "printdefault" to print directly to default printer (no dialog) - takes browser object only
  • Internal global variable $__IEAU3Debug added. If True, additional debug information (from _IELoadWait) written to the console
Changes
  • _IEFrameGetObjByName() no longer accepts a $i_index parameter. Two frames with the same name is invalid in the DOM
  • Deprecated functions from T1.0 moved out of this file and into new file IE_V1Compatibility.au3
T2.0-3 6/1/06

Fixes

  • fixed bug in _IELinkClickByIndex() - Invalid characters behind Object assignment ! (thanks 3telnick)
  • fixed bug in _IEFrameGetObjByName()
  • fixed bug in _IEFormElementGetObjByName()
  • fixed index bug in _IEFormElementOptionselect()
Enhanced Functions
  • added bounds checking for index value used with _IEFormElementOptionselect()
  • added a sixth element to the array returned by _IE_VersionInfo() with a display value of the version (e.g. T2.0-3)
T2.0-2 5/30/06

Fixes

  • all *GetObjByName functions return correct collection count in @EXTENDED
  • _IEErrorNotify(True) now works (previously 1 worked, True did not)
Enhanced Functions
  • _IELoadWait() now traps COM errors that used to abort script. Assumes these errors are transient and continues until timeout
  • _IELoadWait() now traps Frame cross-site scripting security errors and returns with $_IEStatus_AccessDenied warning

    Note: for _IELoadWait() to trap COM errors, it is critical that you use _IEErrorHandlerRegister() if using your own COM error handler

  • when @ERROR is set, @EXTENDED contains invalid parameter number for most functions
  • _IE_Introduction() enhanced with more information
  • _IEExample() new modules: table, frameset, iframe
  • _IEExample() enhanced modules: basic, form
Changes
  • _IEQuit() returns $_IEStatus_InvalidObjectType error for anything other than a browser object (including embedded controls)
New Functions
  • NONE
T2.0-1 5/13/06

Fixes

  • fixed Timeout for _IELoadWait
  • fixed _IEErrorHandler routines (were a no op)
  • fixed *GetObjByName functions to return 0 and set @error to $_IEStatus_NoMatch when no match was found
Enhanced Functions
  • added symboloic error status codes
  • added Object type checks
  • added bounds checking for Index values in *Collection routines
  • all functions now write colsole messages when errors or warnings are encountered - can be turned on or off with _IEErrorNotify()
Changes
  • reversed order of $s_string and $s_name parameters in _IEFormElementRadioSelect() function
  • added optional $s_name parameter to _IEFormElementCheckboxSelect() function
New Functions
  • _IE_Introduction() added - Currently pretty basic. Intended to supplement the helpfile with overview information
  • _IE_Example() added - currently allow "basic" and "form" to create windows with stock elements to be used in other examples
  • _IE_VersionInfo() added - returns a 5-element array with version inforamtion for IE.au3
  • _IEErrorNotify() added - turn orr or on console messages alerting IE.au3 warnings and errors. On by default. With null parameter it returns current status
T2.0-0 5/4/06

Enhanced Functions

  • _IECreate() greatly enhanced to take new parameters
  • _IEAttach() enhanced with "embedded" for embedded browser controls
  • _IEAttach() enhanced with "dialogbox" for HTML modal and modeless dialogboxes
  • _IELoadWait() enhanced/rewritten to fix timing issues and work on arbitrary object types
  • _IELoadWait() enhanced with timeout parameter (also honors global setting controlled by _IELoadWaitTimeout() - default 5 minutes)
  • _IEFormSubmit() enhanced to optionally perform an _IELoadWait
  • _IEFormElementSetValue() enhanced by optionally firing onchange event
  • _IETableWriteToArray enhanced to negotiate spanned columns (when there is a colSpan, leftmost array alement will contain data, others will be null)
  • _IETagNameGetCollection() enhanced to work with InternetExplorer.Application, Window, Frame, iFrame or any object in the DOM
  • _IETagNameAllGetCollection() enhanced to work with InternetExplorer.Application, Window, Frame, iFrame or any object in the DOM
  • _IEAction() enhanced with cut, paste, delete, saveas, click, disable, enable
  • _IEPropertyGet() enhanced - "HWND" now returns a valid window handle (instead of string representation of HWND)
  • _IEPropertyGet() enhanced with fullscreen, isDisabled and silent
  • _IEPropertyGet() enhanced with a series of properties avaiable from the browser "navigator" (aka clientInfo) property
  • All *GetCollection and *GetObjByName functions enhanced so that @EXTENDED returns collection length
  • All *GetCollection and *GetObjByName functions enhanced to take a $i_index parameter - if -1, returns a collection, else returns a specific instance by 0-based index. This allows deprecation of *GetCount and *GetObjbyIndex functions
New Functions
  • _IELoadWaitTimeout()
  • _IEGetObjByName()
  • _IECreateEmbedded()
  • _IEBodyReadText()
  • _IEDocReadHTML()
  • _IEDocWriteHTML()
  • _IEHeadInsertEventScript()
  • _IEImgGetCollection()
  • _IELinkGetCollection()
  • _IEFormElementOptionselect()
  • _IEFormElementCheckBoxSelect()
  • _IEFormElementRadioSelect()
  • _IEFormElementImageClick()
  • _IEPropertySet()
  • _IEErrorHandlerRegister()
  • _IEErrorHandlerDeRegister()
Deprecated Functions (these are not documented and will be removed from the next release)
  • _IEFrameGetObjByIndex() migrate to:

    $oFrame = _IEFrameGetCollection($oIE, your-index)

  • _IEFrameGetCount() migrate to:

    $oFrames = _IEFrameGetCollection($oIE), $iCount = @EXTENDED

  • _IEFrameGetNameByIndex() migrate to:

    $oFrame = _IEFrameGetCollection($oIE, your-index), $sName = $oFrame.name

  • _IEFrameGetSrcByIndex migrate to:

    $oFrame = _IEFrameGetCollection($oIE, your-index), $src = $oFrame.src

  • _IEFrameGetSrcByName migrate to:

    $oFrame = _IEFrameGetObjByName($oIE, "framename"), $src = $oFrame.src

  • _IEFormGetObjByIndex() migrate to:

    $oForm = _IEFormGetCollection($oIE, your-index)

  • _IEFormGetCount() migrate to:

    $oForms = _IEFormGetCollection($oIE), $iCount = @EXTENDED

  • _IEFormGetNameByIndex migrate to:

    $oForm = _IEFormGetCollection($oIE, your-index)

  • _IEFormElementGetObjByIndex() migrate to:

    $oElement = _IEFormElementGetCollection($oForm, your-index)

  • _IEFormElementGetCount() migrate to:

    $oElements = _IEFormElementGetCollection($oForm), $iCount = @EXTENDED

  • _IEFormElementGetTypeByIndex migrate to:

    $oElement = _IEFormElementGetCollection($oForm, your-index), $sType = $oElement.type

  • _IEFormElementOptionGetCount() migrate to:

    $oElement = _IEFormElementGetObjByName($oForm, your-name), $oElement.options.length

  • _IETableGetObjByIndex() migrate to:

    $oTable = _IETableGetCollection($oIE, your-index)

  • _IETableGetCount() migrate to:

    $oTables = _IETableGetCollection($oIE), $iCount = @EXTENDED

Renamed Functions (deprecated and replaced with new functions)
  • _IEClickLinkByText() renamed to _IELinkClickByText()
  • _IEClickLinkByIndex() renamed to _IELinkClickByIndex()
  • _IEDocumentGetObj() renamed to _IEDocGetObj()
  • _IEClickImg() renamed to _IEImgClick()
  • _IEGetProperty() renamed to _IEPropertyGet()
Known Issues with T2.0-5 Test Release

Here are the things I know about and will fix for the next test release:

  • None reported
Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites



may i be the first to say a big thanks to you and all contributors.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Yes, Great work on this program and the first version.

Edited by Firestorm

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites

maybe you should now work on Firefox.au3 :)

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

That would be neat.

BTW, Im lovin this udf!

EDIT:

Though someone might like this....

It is a example of how to send fake emails using autoit and this udf. It uses Fake Mailer.

here:

#include<IE.au3>
; Set Variables
;==============================================
$message = "Your message here"
$to = "someone@coolness.com"
$from = "billgates@microsoft.com"
$from_name = "Bill Gates"
$subject = "Wow!"
;==============================================
; End Veriables
$oIE = _IECreate(0)
_IENavigate($oIE, "http://www.fake-mailer.com/fmlite/")

; get pointers to the login form and username and password fields
$o_form = _IEFormGetObjByIndex($oIE, 0)
$o_name = _IEFormElementGetObjByName($o_form, "name")
$o_to = _IEFormElementGetObjByName($o_form, "to")
$o_subject = _IEFormElementGetObjByName($o_form, "subject")
$o_from = _IEFormElementGetObjByName($o_form, "from")
$o_message = _IEFormElementGetObjByName($o_form, "message")

; Set field values and submit the form
_IEFormElementSetValue($o_name, $from_name)
_IEFormElementSetValue($o_to, $to)
_IEFormElementSetValue($o_subject, $subject)
_IEFormElementSetValue($o_from, $from)
_IEFormElementSetValue($o_message, $message)
_IEFormSubmit($o_form)
while 1
if Winexists ("Email was sent - Microsoft Internet Explorer") then exitloop
if winexists("http://www.fake-mailer.com/fmlite/sendMail.php") then
WinKill ("http://www.fake-mailer.com/fmlite/sendMail.php")
MsgBox(16,"Email Sender","Error Sending Email")
exit
endif
wend
MsgBox(64,"Email Sender","Email Was Sent")
WinKill ("Email was sent - Microsoft Internet Explorer")

Enjoy!

PS- This code was not tested. Please tell me if there is an error so i may correct it.

Edited by spyrorocks

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

maybe you should now work on Firefox.au3 :)

Mind you I have nothing against Firefox and I use it all the time. It doesn't have a COM api however as IE does so the hooks aren't there. Please see the words under my avatar...

This has been brought up and discussed several times before. This includes discussion of the IE Firefox plugin -- if you stumble on that and think it solves something, it doesn't.

I worry about this topic because it is more about preference (or fanaticism) than it is about technology, so please let's end it here and get back to the topic of the post.

thanks,

Dale

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

:( damn, well ohwell we should email the Firefox people and tell them to get their ass in gear and make it COMable

But good work anyways :)

Edited by thatsgreat2345

Share this post


Link to post
Share on other sites

how can you make it if you havent even tested it.. you know it works without testing?? :)

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

:( damn, well ohwell we should email the Firefox people and tell them to get their ass in gear and make it COMable

But good work anyways :(

Oh, no! Please do not sugest that. COM is somtimes great but running firefox of a usb stick on any computer without poluting the said computer is better. If you want to do automation with firefox you should search for a xml-rpc plugin, and use that :D

COM is native to IE, and belive it or not you can expect it to be installed :) so thanks to @DaleHome, and cotributors, for a great tool :oops:

Edited by Uten

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

That would be neat.

BTW, Im lovin this udf!

EDIT:

Though someone might like this....

It is a example of how to send fake emails using autoit and this udf. It uses Fake Mailer.

here:

You can now combine your _IECreate and _IENavigate into _IECreate.

Also you're using a couple of deprecated functions - *ByIndex.

Care to take a shot at converting it? Other than how it could be abused it is a good example.

Dale

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

#12 ·  Posted

Great work ... thanks

Share this post


Link to post
Share on other sites

#13 ·  Posted

Even though i don't use IE regurly, this is Fantastic work!.

Good job as always.


[size=20]My File Upload[/size]Register at my site and upload.

Share this post


Link to post
Share on other sites

#14 ·  Posted

thanks for the new release. Well done.


My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

ok, here is the updated version of my Fake Mail sender......

#include<IE.au3>
; Set Variables
;==============================================
;                           For Use with IE.au3 version 2.0 !
;                        This code is (C) 2006
$message = "Your message here"
$to = "someone@coolness.com"
$from = "billgates@microsoft.com"
$from_name = "Bill Gates"
$subject = "Wow!"
$silent = 0; 0 = No Message Boxes 1 = Message boxes
;==============================================
; End Veriables
$i = 1
$oIE = _IECreate("http://www.fake-mailer.com/fmlite/",0, 0)

; get pointers to the login form and username and password fields
$o_form = _IEFormGetCollection($oIE, 0)
$o_name = _IEFormElementGetObjByName($o_form, "name")
$o_to = _IEFormElementGetObjByName($o_form, "to")
$o_subject = _IEFormElementGetObjByName($o_form, "subject")
$o_from = _IEFormElementGetObjByName($o_form, "from")
$o_message = _IEFormElementGetObjByName($o_form, "message")

; Set field values and submit the form
_IEFormElementSetValue($o_name, $from_name)
_IEFormElementSetValue($o_to, $to)
_IEFormElementSetValue($o_subject, $subject)
_IEFormElementSetValue($o_from, $from)
_IEFormElementSetValue($o_message, $message)
_IEFormSubmit($o_form)
while $i = 1
if Winexists ("Email was sent - Microsoft Internet Explorer") then
$i = 0
exitloop
endif
if winexists("http://www.fake-mailer.com/fmlite/sendMail.php") then
WinKill ("http://www.fake-mailer.com/fmlite/sendMail.php")
if $silent = 1 then MsgBox(16,"Email Sender","Error Sending Email")
$i = 0
exit
endif
wend
if $silent = 1 then MsgBox(64,"Email Sender","Email Was Sent")
WinKill ("Email was sent - Microsoft Internet Explorer")

Want do you all think?

Edited by spyrorocks

Share this post


Link to post
Share on other sites

#16 ·  Posted

Hi,

very nice example. Just a thought, I would change the while 1 into something with a break condition, cause otherwise in "error case" the script won't end.

I have a different proxy configuration at work, so I have to change it at home. Otherwise the ie won't get access to the internet. :)

Thanks!

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

#18 ·  Posted

Fixed. Thanks!

HI,

another point: When you have configured a proxy which isn't available it still doesn't exit.

I changend it into :

#include<IE.au3>
; Set Variables
;==============================================
;                           For Use with IE.au3 version 2.0 !
;                        This code is (C) Brad Reddicopp 2006
$message = "Your message here"
$to = "vibroei@gmx.de"
$from = "billgates@microsoft.com"
$from_name = "Bill Gates"
$subject = "Wow!"
$silent = 1; 0 = No Message Boxes 1 = Message boxes
;==============================================
; End Veriables
$i = 1
$oIE = _IECreate ("http://www.fake-mailer.com/fmlite/", 0, 0)
; get pointers to the login form and username and password fields
$o_form = _IEFormGetCollection ($oIE, 0)
$o_name = _IEFormElementGetObjByName ($o_form, "name")
$o_to = _IEFormElementGetObjByName ($o_form, "to")
$o_subject = _IEFormElementGetObjByName ($o_form, "subject")
$o_from = _IEFormElementGetObjByName ($o_form, "from")
$o_message = _IEFormElementGetObjByName ($o_form, "message")

If @error = 1 Then 
    MsgBox(0, "Error","No connection")
    Exit(0)
EndIf

; Set field values and submit the form
_IEFormElementSetValue ($o_name, $from_name)
_IEFormElementSetValue ($o_to, $to)
_IEFormElementSetValue ($o_subject, $subject)
_IEFormElementSetValue ($o_from, $from)
_IEFormElementSetValue ($o_message, $message)
_IEFormSubmit ($o_form)

While $i = 1
    If WinExists("Email was sent - Microsoft Internet Explorer") Then
        $i = 0
        ExitLoop
    EndIf
    If WinExists("http://www.fake-mailer.com/fmlite/sendMail.php") Then
        WinKill("http://www.fake-mailer.com/fmlite/sendMail.php")
        If $silent = 1 Then MsgBox(16, "Email Sender", "Error Sending Email")
        $i = 0
        Exit
    EndIf
WEnd
If $silent = 1 Then MsgBox(64, "Email Sender", "Email Was Sent")
WinKill("Email was sent - Microsoft Internet Explorer")

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

HI,

another point: When you have configured a proxy which isn't available it still doesn't exit.

spyrorocks posted a copy of his script and has asked for comments here: Fake Emailer Function, Here It Is!

I'd like to ask that specific discussion of this be moved there and this thread be used for discussion specific to IE.au3

thanks,

Dale

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

#20 ·  Posted

For anyone that hasn't seen the 1st version of this UDF (like me) it's kind of confusing as to what it all does...

Not even the documentation explains what the main purpose of the script is :-/

Anyone care to explain? maybe give some exmpales? Thanx.

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