Jump to content

Email Object


Skrip
 Share

Recommended Posts

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

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 SDK

err.number is: 80020009

err.lastdllerror is: 0

err.scriptline is: 183

err.source is: CDO.Message.1

err.helpfile is:

err.helpcontext is: 0

Test failed!

Edited 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

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...