anixon Posted May 2, 2007 Share Posted May 2, 2007 I have not been able to locate any instalment that deals with attachments not being transported. This is the code CODEGlobal $error = 0 $oMyError = ObjEvent("AutoIt.Error", "ErrFunc") $objMessage = ObjCreate ("CDO.Message") With $objMessage .Subject = "Who am I" .Sender = "anyone@anywhere.com" .From = "" .To = "someone@somewhere.com" .TextBody = "test" .AddAttachment = ("c:\temp\test.txt") EndWith With $objMessage.Configuration.Fields .Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.SERVER.com" ; <== SMTP SERVER .Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 .Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "anyone@anywhere.com" ; <== SMTP USERNAME .Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "xyz" ; <== SMTP PASSWORD .Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 .Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 .Update EndWith $objMessage.Send Func ErrFunc() $error = 1 Endfunc If $error = 1 Then msgbox(0,"","Error Detected") $error = 0 Else msgbox(0,"","Error NOT Detected") EndIf The code when run reports an error. However the email is sent but the receipient does not receive the attachment. My guess is that the error is due to the attachment not being processed by the routine. Is there a solution to this issue? Ant... Link to comment Share on other sites More sharing options...
Zedna Posted May 2, 2007 Share Posted May 2, 2007 $objMessage.AddAttachment ("c:\temp\test.txt") Note: it's without = Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
anixon Posted May 2, 2007 Author Share Posted May 2, 2007 Thanks for that its was very much appreciated. Now it works perfectly. I guess that sometimes we cannot see the woods for the trees. I'd hate to tell you how long I have played with that one and not identified that the problem was the equals (=). Boy do I feel sheepish......... Ant.. 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