Scriptonize Posted August 14, 2009 Posted August 14, 2009 (edited) Is "_INetSmtpMailCom" a function you wrote?I'm only aware of "_INetSmtpMail" and that UDF doesn't mention attachments.[[EDIT]] Never mind, I just found that UDF in another thread.[[EDIT2]]I 've used it like this and that seems to work:Code snippet....#include <array.au3> ;my vars Global $arrAttachments Global $Attachment Global $MyFolder = "C:\Tmp" ;fill the array with files... $arrAttachments = _FileListToArray($MyFolder,"file.*",1) ;When we have found files, add the full path to the found files in the array... If IsArray($arrAttachments) Then For $i = 1 to UBound($arrAttachments) - 1 $arrAttachments[$i] = $MyFolder & "\" & $arrAttachments[$i] Next ;this line is used to check the content of the array (it's not needed for the function) _ArrayDisplay($arrAttachments) Else ;no files no mail, beep as warning (not needed, just added for convenience) Beep(75,100) Exit EndIf ;create the attachment string, separated by semicolons... For $i = 1 To UBound($arrAttachments) - 1 $Attachment = $Attachment & $arrAttachments[$i] & ";" Next ;start spamming my mailbox..... $result = _INetSmtpMailCom("My Mailserver","My friendly name here", "my.name@mymailserver.com","your.name@yourmailserver.com", "MySubject" ,"MyMessageBody",$Attachment,"") ;If there is an error show it.... If $result = 0 Then $result = @error ConsoleWrite("$result= " & $result & @CRLF) Exit Edited August 14, 2009 by Scriptonize If you learn from It, it's not a mistake
AJJ Posted August 14, 2009 Author Posted August 14, 2009 hey, ok cool that looks better, but it still says unknown function name on the _filelisttoarray, do i have to include that other code as an array.au3 in the same directory? also, where do i put in my password for gmail? also, what is the my server name? also, dont i have to attache the smtp.au3?
nfaustin Posted August 14, 2009 Posted August 14, 2009 #Include <File.au3> is for function _FileListToArray() [font="Palatino Linotype"][size="2"]*** The information contained in this post should be considered and certified WORKS ON MY MACHINE ***[/size][/font][font="Palatino Linotype"][size="2"] [/size][/font]
Scriptonize Posted August 14, 2009 Posted August 14, 2009 hey, ok cool that looks better, but it still says unknown function name on the _filelisttoarray, do i have to include that other code as an array.au3 in the same directory?also, where do i put in my password for gmail? also, what is the my server name?also, dont i have to attache the smtp.au3?As I wrote above my example:Code snippetIt's just a part of the whole story.You need to combine your code with those parts that are useful to you. If you learn from It, it's not a mistake
AJJ Posted August 14, 2009 Author Posted August 14, 2009 dude, you legend!! it works!! w000t thank you so much, i added all my bits in and its all running smoothly now. im just now trying it with a really big folder, what would you have to do to limit the size of files sent? like customise the size so that it would take certain files of certain sizes or maybe from certain times, that might be asking a bit much, i dont want to be greedy, im very happy with the script now! it just made me think because i guess gmail must have a limit it can upload and download... intersting!
AJJ Posted August 14, 2009 Author Posted August 14, 2009 thats awesome, ive got it to upload some really quite large files! i wonder what happens when it gets too much. also another just generic Autoit question, why dont we make all of the variables global just in case they might be used else where as some point?
AJJ Posted August 14, 2009 Author Posted August 14, 2009 also just another little question, is there any tools with AUTOit that allow you to look at the explaintion and different sub bits within the code (not just going to the appropriate text file) infact that would be an awesome little program to write, something that explains the function, macro etc. when you hold your curser over it!
Scriptonize Posted August 14, 2009 Posted August 14, 2009 thats awesome, ive got it to upload some really quite large files! i wonder what happens when it gets too much. also another just generic Autoit question, why dont we make all of the variables global just in case they might be used else where as some point?Limit on file size send/receive or mailbox size are server side settings.It's up to the owner of the server what settings he uses. If you learn from It, it's not a mistake
AJJ Posted August 14, 2009 Author Posted August 14, 2009 but am i right in thinking that if the script has more than 10 meg worth of files to send it just wont work?
Scriptonize Posted August 14, 2009 Posted August 14, 2009 but am i right in thinking that if the script has more than 10 meg worth of files to send it just wont work?As far as I know about Gmail, mailbox size will not be a problem.File size limitation settings I don't know.Just try it, you will receive an error if the size is to big. If you learn from It, it's not a mistake
AJJ Posted August 14, 2009 Author Posted August 14, 2009 this is weird, it lets you send "file.*" and *.txt but not *.*, why is that?
AJJ Posted August 14, 2009 Author Posted August 14, 2009 is there any way to limit how many files it sends at once? or put a limit on how much worth of data it can send at once?
AJJ Posted August 14, 2009 Author Posted August 14, 2009 also, and sorry for all these questions, but is it possible to easily make it search sub directories?
AJJ Posted August 15, 2009 Author Posted August 15, 2009 is there somewhere on these forums to ask the random questions like these? dont want to mess us the system or anything,
Moderators Melba23 Posted August 15, 2009 Moderators Posted August 15, 2009 AJJ, I gave you a function to search in subfolders in your other topic - you can find it here. As I said at the time, it actually uses functionality only found in the current Beta to work - if you are using 3.3.0.0 or earlier, let me know and I will post an amended version. It just takes a bit longer to complete with the "older" code. As to random questions: the rule is generally that if it has something to do with the content of the previous posts, add a post - if it is on a different matter altogether, start a new topic. So I would say you are doing fine at present. The only problem is that once topics last too long, the chances of a newcomer entering the topic diminish - I only looked in here because i saw your name and helped in your other topic. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
AJJ Posted August 16, 2009 Author Posted August 16, 2009 so with that function you gave me can i now just put that in a use it like this: _functionyougaveme(@scriptdir & "subfolder" & "*.txt")? what sort of commands might i be able to use?
Moderators Melba23 Posted August 16, 2009 Moderators Posted August 16, 2009 AJJ,All the instructions are in the file header - play about with the function until you understand how it works. ; Syntax.........: _RecFileListToArray($sPath[, $sInclude_List = "*"[, $iReturn = 0[, $fRecur = 0[, $sExclude_List = ""[, $iFullPath = 0]]]]])To give a quick idea, to list all the .txt files in the script folder and all subfolders, you would use:_RecFileListToArray((@scriptdir & "\" & "subfolder", "*.txt", 1, 1)Remember that @ScriptDir does NOT have a trailing backslash!But as a matter of principle you should never just blindly use functions in your code when you are unsure of the results they give. I would strongly urge that you use _ArrayDisplay to check the results of some tests first.;-----If you use the full SciTE4AutoIt3 package (and if not, why not? You gain a lot!) you will need to set it up to run the Beta release. Go to "Options -> Open au3 Properties". About line 33 you will see:## Switch used to Enable/Disable all Tools used for AutoIt3 BetaBETA_AUTOIT=Make sure that it =1 and not =0. Then save the file (you may have to restart SciTE as well - I cannot remember) and you will have a whole new set of "Beta" options in the "Tools" menu. For my function to work, you need to run or compile your script using these "Beta" options as it uses a functionality which at the moment is only available in the Beta release.Have fun!M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
AJJ Posted August 16, 2009 Author Posted August 16, 2009 hey again, i got it searching sub folders by changing the default settings in the _recfilelistoarray, and then the array display said that i had found them ok, and when i closed it was clearly working for a while and then just did nothing! why would that be (it worked before i changed it to _recfilelist... just using the old find array function. am i right in thinking that the light blue functions that you use are the default ones built into the program and compiler and the ones that show up as black such as "_recfileslisttoarray" are outside ones that have to be attached seperately?
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