Mosquitos Posted May 25, 2005 Share Posted May 25, 2005 If someone can use this script or can translate it in au3 Dim WSHShell Set WSHShell = WScript.CreateObject("WScript.Shell") const URL = "http://xml.showmyip.com/" set xmldoc = CreateObject("Microsoft.XMLDOM") xmldoc.async=false xmldoc.load(URL) for each x in xmldoc.documentElement.childNodes if x.NodeName = "ip" then Ip = x.text end if next Set objMessage = CreateObject("CDO.Message") objMessage.Sender = "nobody@nobody.com" objMessage.To = "nobody@nobody.com" objMessage.TextBody = Ip objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.nobody.com" objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 objMessage.Configuration.Fields.Update objMessage.Send Sapiente vince, rex, noli vincere ferro! Link to comment Share on other sites More sharing options...
/dev/null Posted May 25, 2005 Share Posted May 25, 2005 (edited) If someone can use this script or can translate it in au3 I realy like this script. I learned how to parse XML documents and how to send e-mail via a COM object. Realy nice. Thanks!Here is the code in AutoIT.$URL = "http://xml.showmyip.com/" $xmldoc = ObjCreate("Microsoft.XMLDOM") $xmldoc.async=false $xmldoc.load($URL) for $x in $xmldoc.documentElement.childNodes if $x.NodeName = "ip" then $ip = $x.text endif next msgbox(4096,"", "My IP: " & $ip) $objMessage = ObjCreate("CDO.Message") ;$objMessage.Sender = "nobody@nobody.com"; <== Sender seems to be wrong. Better use .From (next line) $objMessage.From = "nobody@nobody.com" $objMessage.To = "nobody@nobody.com" $objMessage.Subject = "INFO: IP address" $objMessage.TextBody = "Your IP: " & $ip $objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 $objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.nobody.com" $objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 $objMessage.Configuration.Fields.Update $objMessage.Send msgbox(4096,"", "Message was sent. Check your Inbox")Cheers Kurt Edited May 25, 2005 by /dev/null __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
Mosquitos Posted June 5, 2005 Author Share Posted June 5, 2005 Because is a little bit the same script i post it here... Set objMessage = CreateObject("CDO.Message") objMessage.Subject="Test" objMessage.From="nobody@nobody.com" objMessage.To="nobody@nobody.com" objMessage.CreateMHTMLBody "file://c:/test.htm" objMessage.Send or Set objMessage = CreateObject("CDO.Message") objMessage.Subject = "Test" objMessage.Sender = "nobody@nobody.com" objMessage.To = "nobody@nobody.com" objMessage.TextBody = "Test" objMessage.AddAttachment "c:\test.htm" objMessage.Send Is these, objMessage.CreateMHTMLBody "file://c:/test.htm" and these, objMessage.AddAttachment "c:\test.htm" possible with autoit? Sapiente vince, rex, noli vincere ferro! Link to comment Share on other sites More sharing options...
/dev/null Posted June 5, 2005 Share Posted June 5, 2005 Is these, .... possible with autoit?Just try it and you will see .... I gave you the code to start with.CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
Mosquitos Posted June 6, 2005 Author Share Posted June 6, 2005 No it don't work He give this error: C:\Documents and Settings\Yves\Mijn documenten\Test.au3 (20) : ==> The requested action with this object has failed.: $objMessage.AddAttachment = "c:\test.htm" $objMessage.AddAttachment = "c:\test.htm"^ ERROR Sapiente vince, rex, noli vincere ferro! Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted June 6, 2005 Share Posted June 6, 2005 I haven't been able to get the AddAttachment to work either in my own scripts...maybe sometime soon. (Don't ask me, I have no clue about COM objects) Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Link to comment Share on other sites More sharing options...
/dev/null Posted June 6, 2005 Share Posted June 6, 2005 $objMessage.AddAttachment = "c:\test.htm"Try this.$objMessage.AddAttachment("c:\test.htm")CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
Mosquitos Posted June 7, 2005 Author Share Posted June 7, 2005 Try this.$objMessage.AddAttachment("c:\test.htm")CheersKurt<{POST_SNAPBACK}>Thanks works both now. Sapiente vince, rex, noli vincere ferro! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now