
lte5000
Active Members-
Posts
105 -
Joined
-
Last visited
Everything posted by lte5000
-
Hi, I'm trying to use the Ostrosoft SMTP component v7 with AutoIt v3.3.0.0 on Windows XP SP3. The component works fine with VBScript. In AutoIt I always get the following COM error: 0x8002000B - Invalid index The error occurs at this script line: ObjEvent($oSMTP, "oSMTP_")The email does get sent out successfully, but the script times out because the oSMTP_ events are never fired. Thanks for any assistance, Kendall vb script: 'VBScript sample for OstroSoft SMTP Component Option Explicit Dim oSMTP 'As OSSMTP.SMTPSession Dim sStatus 'As String Dim bClose 'As Boolean Dim nTimeout 'As Long Dim n 'As Long sStatus = "" bClose = False nTimeout = 1000 n = 0 Set oSMTP = CreateObject("OSSMTP.SMTPSession") WScript.ConnectObject oSMTP, "oSMTP_" oSMTP.RaiseError = True oSMTP.Server = "mail server" oSMTP.AuthenticationType = 2 oSMTP.Username = "username" oSMTP.Password = "password" oSMTP.Port = 587 oSMTP.MailFrom = "email address" oSMTP.SendTo = "email address" oSMTP.MessageText = "test" oSMTP.MessageSubject = "test" oSMTP.SendEmail Sub oSMTP_ConnectSMTP() 'connected to mailserver End Sub Sub oSMTP_SendSMTP() 'message successfully sent End Sub Sub oSMTP_StatusChanged(ByVal Status) sStatus = sStatus & oSMTP.Status & vbCrLf End Sub Sub oSMTP_ErrorSMTP(ByVal Number, Description) 'error occured sStatus = sStatus & "Error " & Number & ": " & Description & vbCrLf bClose = True End Sub Sub oSMTP_CloseSMTP() 'connection to mailserver closed bClose = True End Sub Do While Not bClose WScript.Sleep 1 n = n + 1 If n > nTimeout Then sStatus = sStatus & "Timeout" & vbCrLf Exit Do End If Loop WScript.Echo sStatus Set oSMTP = Nothing AutoIt: AutoItSetOption("MustDeclareVars", 1) Global $oMyRet[2], $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc") Dim $oSMTP Dim $sStatus Dim $bClose Dim $nTimeout Dim $n $sStatus = "" $bClose = 0 $nTimeout = 1000 $n = 0 $oSMTP = ObjCreate("OSSMTP_Plus.SMTPSession") ObjEvent($oSMTP, "oSMTP_") $oSMTP.RaiseError = True $oSMTP.Server = "mail server" $oSMTP.AuthenticationType = 2 $oSMTP.Username = "username" $oSMTP.Password = "password" $oSMTP.Port = 587 $oSMTP.MailFrom = "email address" $oSMTP.SendTo = "email address" $oSMTP.MessageText = "test" $oSMTP.MessageSubject = "test" $oSMTP.SendEmail () Func oSMTP_ConnectSMTP() ;connected to mailserver EndFunc;==>oSMTP_ConnectSMTP Func oSMTP_SendSMTP() ;message successfully sent EndFunc;==>oSMTP_SendSMTP Func oSMTP_StatusChanged($Status) $sStatus = $sStatus & $Status & @CRLF EndFunc;==>oSMTP_StatusChanged Func oSMTP_ErrorSMTP($Number, $Description) ;error occured $sStatus = $sStatus & "Error " & $Number & ": " & $Description & @CRLF $bClose = 1 EndFunc;==>oSMTP_ErrorSMTP Func oSMTP_CloseSMTP() ;connection to mailserver closed $bClose = 1 EndFunc;==>oSMTP_CloseSMTP While Not $bClose Sleep(15) $n = $n + 1 If $n > $nTimeout Then $sStatus = $sStatus & "Timeout" & @CRLF ExitLoop EndIf WEnd MsgBox(0, "", $sStatus) $oSMTP = "" ;custom defined error handler Func MyErrFunc() Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & hex($oMyError.number,8) & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) Endfunc
-
Website data storage - Database vs INI file?
lte5000 replied to lte5000's topic in AutoIt General Help and Support
Thanks for the advice, I'll probably be checking into it. -
Hi, I'm running a small Abyss + AutoIt3 powered website, for a project of mine. Users can make up to twenty (20) choices on my site. I then need to store the users' choices. Currently, I'm using one (1) INI file for data storage. This INI file has a section for each user and each user's selections are written to keys in that section. However, if multiple users access my site simultaneously, there is the possibility of data corruption in the INI file... correct? I was wondering what my next step should be: SQlite - looks scary - or INI file with some sort of mechanism to prevent data corruption? Thanks for any advice.
-
Have you been perusing the docs for the _IE functions? (in the AU3 help file under 'User Defined Functions' > 'IE Management') Anyway, I assume you are using _IEFormSubmit to click the 'submit button'? Try this: _IEFormSubmit ($TheForm, 0)oÝ÷ Ú)ìµæ¡ûaÆ®¶sbôTf÷&Õ7V&ÖBb33cµFTf÷&Ò
-
Wouldn't know... without seeing your code.
-
Welcome!Without those extra parameters (actually the fourth parameter) _IECreate just waits and waits and the page never loads
-
DuncanM, I ran into something like this a bit ago. Give this code a try. #include <IE.au3> $oIE = _IECreate("https://192.168.100.1", 0, 1, 0) WinWait("Client Authentication", "The Website you want to view") ControlSend("Client Authentication", "OK", 1) HTH.
-
theguy0000 or anyone else, could you provide a short example of how to use session variables? I played with it a bit but did not quite understand how to correctly use them (session vars). Thanks for your work on this project! Edit: What I had in mind: A script that would allow someeone to enter a username and password and then remeber that they are logged in for the entire session. Is that doable?
-
StringReplace unexpected behavior
lte5000 replied to lte5000's topic in AutoIt General Help and Support
I expected the first character (position 1) to be replaced with ""... because...well...just because. But after thinking it through, your explanation makes more sense. Thanks. -
Expected results: $a = "abc" $a = StringReplace($a, "a", "") MsgBox(0, "contents of var $a", $a)Result of StringReplace() is "abc". I expected "bc". Bug? Intended behavior? I don't know. Thanks in advance for checking it out. Edit: added what I expected.
-
Smtp Mailer That Supports Html And Attachments.
lte5000 replied to Jos's topic in AutoIt Example Scripts
I think maybe you should change $objEmail.Textbody = $as_Body & @LF to $objEmail.Textbody = $as_Body & @CRLF Thanks for the UDF. -
I guess its just for fun, but I broke through the security by: 1. Click mouse button to generate a "BREAK IN" error. 2. Press Ctrl+Shift+ESC to bring up the task manager and quickly end "autoit3.exe". Perhaps there would be ways to prevent this from happening, too. Edit: fix spelling
-
Goto or Skip to Line Comand
lte5000 replied to WaterFish22's topic in AutoIt General Help and Support
Hello, Didn't look at you code closely. Hope these links get you started: http://www.autoitscript.com/autoit3/docs/faq.htm#4 http://www.autoitscript.com/forum/index.ph...b&highlite=goto Kendall -
Help troubleshoot my code for "inpout32.dll", please.
lte5000 replied to lte5000's topic in AutoIt General Help and Support
Larry, that is so great! Thank you many times over... Edit: I should have read the DLLCall() docs, sorry... DLLCall docs... Thanks again, Kendall -
Help troubleshoot my code for "inpout32.dll", please.
lte5000 replied to lte5000's topic in AutoIt General Help and Support
Ok, I guess I had a corrupt version of inpout32.dll. I'm not getting the crashes with the correct copy. The copy I had earlier was 27k in size, vs. the correct size of 32k. Thanks for the support. I do have one more question. Why can't I get any return from the "Inp32" function of inpout32.dll? Here's my code: $r = DllCall("inpout32.dll", "short", "Inp32", "short", 0x379) MsgBox(0, "In2", "@Error: " & @error & @LF & "Result: " & Number($r))This should be returning the state of the parallel port's four input pins. It seems to return nothing. Using this function from C I get decimal 127 (hex 007F). AutoIt should be able to interpret that return data, or not? Thanks, Kendall Edit: See first post for correct DLL copy. -
Help troubleshoot my code for "inpout32.dll", please.
lte5000 replied to lte5000's topic in AutoIt General Help and Support
The code works (doesn't crash)... but likewise, my code, now! My code was working (not crashing) yesterday, too, at least under some circumstances. Weird. I also found "io.dll" on another site, which seems to function correctly. BTW, RAMzor, could you give me an example of how to get the state of an input pin on the parallel port, using "inpout32.dll" or some other XP compatible DLL? I want to connect a simple input switch to the parallel port. I don't really understand how to read the state of the pins. I might research it more sometime. Kendall Edit: Thanks for the support, everyone. -
Help troubleshoot my code for "inpout32.dll", please.
lte5000 replied to lte5000's topic in AutoIt General Help and Support
Hmm, does this mean something to me? Maybe I should just use another solution. Thanks, Kendall -
Help troubleshoot my code for "inpout32.dll", please.
lte5000 replied to lte5000's topic in AutoIt General Help and Support
I updated a few things. See first post. -
Edit: The attached copy of the DLL was corrupt, I believe. I have now attached an intact copy. "Inpout32.dll" information: A versatile Dynamic Link Library for parallel port interfacing. Can be used on both WIN9X and WIN NT/2000/XP machines. Home page. Here's the code I have: DllCall("inpout32.dll", "none", "Out32", "int", 0x378, "int", 0) ;First param is parallel port address. ;Second param is value to write to the port.However, that code produces an AutoIt3 crash. Tested with beta and stable. Could someone help me out by testing (or experience) , or am I making a dumb mistake? I have attached a copy of "inpout32.dll". Or, you can download "inpout32.dll" and sources, here. Also, below is some C# code for the same DLL: using System; using System.Runtime.InteropServices; public class PortAccess { [DllImport("inpout32.dll", EntryPoint="Out32")] public static extern void Output(int adress, int value); } Thanks, If any more information needed, just ask, Kendall Edit1: Tidy. Edit2: Tidy and add info. Edit3: Tidy and add info. Edit4: Correction. inpout32.dll
-
Yep, that would be better. Kendall Edit: I didn't realize there was: &= ..'til now. Edit: Spelling.
-
If you use the AutoIt beta, then the example below would be another option. It does not require external programs or temp files to function. Instead, it use the inbuilt StdoutRead() beta function. #include <Constants.au3> Global $cmdOUT = '' $PID = Run("ipconfig /all", "", @SW_HIDE, $STDOUT_CHILD) While NOT @ERROR $cmdOUT &= StdoutRead($PID) Wend MsgBox(1, "IPConfig Output:", $cmdOUT) -Kendall Edit: Changed example to w0uter's suggestion. Edit: Spelling. Edit: Code box cleanup.
-
http://www.jsware.net/jsware/scripts.html
-
Nice. Kendall
-
Why not use DllCall? DllCall("shell32.dll", "long", "ShellExecute", "hwnd", 0, "string", "", "string", "http://www.autoit3.com/", "string", "", "string", "", "long", @SW_SHOWNORMAL) Thanks to this post. Kendall
-
{LCTRL} = Left CTRL key {RCTRL} = Right CTRL key Nothing about {crtl} in the help file. Kendall