NSearch Posted December 27, 2005 Posted December 27, 2005 I am trying to write a script with attaches a file to an email and automatically sends it out. Is there any way to use _INetMail and attach files? Or is there a different function that I could use? Thanks.
Mosquitos Posted December 27, 2005 Posted December 27, 2005 Maybe you can try something like this.... $objMessage = ObjCreate("CDO.Message") $objMessage.From = "nobody@nobody.com" $objMessage.To = "nobody@nobody.com" $objMessage.Subject = "Test" $objMessage.TextBody = "Test" $objMessage.AddAttachment(@ScriptDir & "\Test.txt") $objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 $objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "your providers smtp" $objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 $objMessage.Configuration.Fields.Update $objMessage.Send Sapiente vince, rex, noli vincere ferro!
MSLx Fanboy Posted December 27, 2005 Posted December 27, 2005 Just a note, the AddAttachment method requires that the parameter be the exact path to a file (not relative). @WorkingDir & '\file.txt' may be a more appropriate approach depending upon your situation Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate())
ahha Posted January 16, 2006 Posted January 16, 2006 I'm new to AutoIt, so can you explain which #include I need to use to get the ObjCreate("CDO.Message") to work? Thanks
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