Skrip Posted November 26, 2009 Share Posted November 26, 2009 Hey guys, I've been using this code to send emails, but it seems to no longer work. I'm in Win7 64x. The message box when ran returns nothing at all. Is it not supposed to return an object? Func _INETSMTPMAILCOM($S_SMTPSERVER, $S_FROMNAME, $S_FROMADDRESS, $S_TOADDRESS, $S_SUBJECT = "", $AS_BODY = "", $S_USERNAME = "", $S_PASSWORD = "", $IPPORT = 25, $SSL = 1) Local $OBJEMAIL = ObjCreate("CDO.Message"); Create Mail Object MsgBox(0, "", $OBJEMAIL) $OBJEMAIL.From = '"' & $S_FROMNAME & '" <' & $S_FROMADDRESS & ">" $OBJEMAIL.To = $S_TOADDRESS $OBJEMAIL.Subject = $S_SUBJECT $OBJEMAIL.Textbody = $AS_BODY & @CRLF $OBJEMAIL.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 $OBJEMAIL.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $S_SMTPSERVER $OBJEMAIL.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = $IPPORT If $S_USERNAME <> "" Then $OBJEMAIL.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 $OBJEMAIL.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = $S_USERNAME $OBJEMAIL.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $S_PASSWORD EndIf If $SSL Then $OBJEMAIL.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True EndIf $OBJEMAIL.Configuration.Fields.Update $OBJEMAIL.Fields.Update $OBJEMAIL.Send EndFunc ;==>_INETSMTPMAILCOM Error: (183) : ==> The requested action with this object has failed.: $OBJEMAIL.Send $OBJEMAIL.Send^ ERROR [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] Link to comment Share on other sites More sharing options...
Zedna Posted November 26, 2009 Share Posted November 26, 2009 try $OBJEMAIL.Send() Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
trancexx Posted November 27, 2009 Share Posted November 27, 2009 try$OBJEMAIL.Send()That's not it for sure.@Skrip, you need to add COM error handler too see what's failing. It's probably invalid input (server maybe).Look for ObjEvent() function. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Skrip Posted December 2, 2009 Author Share Posted December 2, 2009 (edited) Okay. Here we are, the error is below. I looked up the error (80020009) but could not find a resolution.We intercepted a COM Error !err.description is: At least one of the From or Sender fields is required, and neither was found.err.windescription: Cannot modify or delete an object that was not added using the COM+ Admin SDKerr.number is: 80020009err.lastdllerror is: 0err.scriptline is: 183err.source is: CDO.Message.1err.helpfile is: err.helpcontext is: 0Test failed! Edited December 2, 2009 by Skrip [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] Link to comment Share on other sites More sharing options...
trancexx Posted December 2, 2009 Share Posted December 2, 2009 Okay. Here we are, the error is below. I looked up the error (80020009) but could not find a resolution.You are kidding, right? ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Skrip Posted December 2, 2009 Author Share Posted December 2, 2009 You are kidding, right?Yes, actually. I installed the COM+ Admin SDK, but I haven't tested the script yet. Hopefully that fixes the issue though. [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] Link to comment Share on other sites More sharing options...
trancexx Posted December 3, 2009 Share Posted December 3, 2009 Yes, actually. I installed the COM+ Admin SDK, but I haven't tested the script yet. Hopefully that fixes the issue though.You are focusing on the wrong description. Just call that freaking function properly. ♡♡♡ . eMyvnE 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