Skysnake Posted September 10, 2010 Posted September 10, 2010 (edited) I have built an array with FileListtoArray (pretty neat, discovered this after writing all of it the long way....) - now I want to pass this Array to the mailer - function call to _INetSmtpMailCom Problem is I do not want to call the _INetSmtpMailCom for each instance in the Array. -> This is the question: I read somewhere (AutoIt Help/Forum?) that [paraphrase] you can pass an Array to a Function and it will repeat until all items in Array have been processed, but first item in Array must... [something] - and this is where I get stuck. Could someone please point me in the right direction? I need to see where to look, or alternate see a little piece of code that shows how I feed my FileListArray to _INetSmtpMailCom - please? Skysnake Edited September 10, 2010 by Skysnake Skysnake Why is the snake in the sky?
water Posted September 10, 2010 Posted September 10, 2010 (edited) If you want to send a single mail and attach all the files in the array to this mail then this should work: $s_AttachFiles = _ArrayToString($yourArray,";",1) ; 1 means that the array has the number of records in element 0 _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, $s_AttachFiles) Taken from the UDF: $AttachFiles = "" ; the file(s) you want to attach seperated with a ; (Semicolon) - leave blank if not needed Edited September 10, 2010 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Skysnake Posted September 10, 2010 Author Posted September 10, 2010 Thanks, I try tonight, reply on Monday. Cheers Skysnake Why is the snake in the sky?
Skysnake Posted September 15, 2010 Author Posted September 15, 2010 The reference I mis-remembered was in the AutoIT help for Call(). Anyway I put it into a FOR/NEXT loop and have achieved what I wanted, thanks. Skysnake Skysnake Why is the snake in the sky?
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