Sign in to follow this  
Followers 0
ryandao

Emailing with AutoIT3

4 posts in this topic

Hi,

I'm trying to AutoIT with JMail to email my co-workers and I after a particular task has been completed. I was able to get JMail to work with Kixtart but wasn't able to get it to work with AutoIT, I'm sure it's my fault since I'm not familiar with AutoIT. Any sample codes for this or another other free email program would be greatly appreciated.

http://www.dimac.net/Products/w3JMail/start.htm

Thx

Ryan

Share this post


Link to post
Share on other sites



There have been a couple of discussion of this recently with working code posted. I'd suggest you search the forums while you wait for someone else to respond who may have specific pointers.

Dale


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

Got AutoIt to work with bmail.

Thx

Share this post


Link to post
Share on other sites

Here's an example that uses COM functionality (requires autoit beta)

;=============================================================
; Global Settings
$smtpserver = "";smtp server address (i.e. mail.server.com)
$smtpuser = "";smtp username (i.e. john_doe)
$smtppass = "";smtp password (i.e. my_s3cret_P@$$)
;
;=============================================================

Func SendEmail($e_Sender, $e_Recipient, $e_Subject, $e_Text)
    $objMessage = ObjCreate ("CDO.Message")
    With $objMessage
        .Subject = $e_Subject
        .Sender = $e_Sender
        .From = $e_Sender
        .To = $e_Recipient
        .TextBody = $e_text
    ;.AddAttachment ("") ;Needs FULL path!!!
    EndWith
    With $objMessage.Configuration.Fields
        .Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
        .Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $smtpserver
        .Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
        .Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = $smtpuser
        .Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $smtppass
        .Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
        .Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
        .Update
    EndWith
    $objMessage.Send
    Return
EndFunc  ;==>SendEmail


;;Error handler functions in case there was an error with email
Dim $oMyError = ObjEvent ("AutoIt.Error", "ErrorHandler")
Func ErrorHandler()
    
    $HexNumber = Hex($oMyError.number, 8)
    
    MsgBox(0, "", "We intercepted a COM Error !" & @CRLF & @CRLF & _
            "err.description is: " & @TAB & $oMyError.description & @CRLF & _
            "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _
            "err.number is: " & @TAB & $HexNumber & @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 _
            )
    
    SetError(1); to check for after this function returns
    Exit
EndFunc  ;==>ErrorHandler

Writing AutoIt scripts since
_DateAdd("d", -2, _NowCalcDate())

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
Sign in to follow this  
Followers 0