r3dbullo88 Posted May 13, 2016 Share Posted May 13, 2016 My first post here, altough I've build all my knowledge in AutoIT thanks to this forum I'll go straight to my case, hopefully someone can help me, current situation: I have an old MFP printer being used as fax server (Forward via mail all incoming faxes), I want to let a PC handle all the incoming faxes, instead of this printer. I've already attached an USB Fax modem and wrote a script which scans every 10 secs the Inbox folder for any image and automatically forwards and archive everything. I want to move a step further and add to the Forwarded Email more details such as FAX Sender / FAX Send Time & Date / Etc. Every help is really appreciated! expandcollapse popup#include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <File.au3> #include <OutlookEx.au3> ; Variable declarations Local $FaxInboxDir = "C:\Users\xxxxx\Documents\Fax\Inbox" Local $FaxArchiveDir = "K:\xxxxx\FAX" Local $FaxLocalArchiveDir = "C:\Users\xxxxx\Documents\Fax\Local Archive" Local $date = @YEAR & "-" & @MON & "-" & @MDAY ; Function to search for new faxes and archive them locally and on K:\ drive Func ArchiveFax() ; Assign a Local variable the search handle of all files in the current directory. Local $hSearch = FileFindFirstFile($FaxInboxDir & "\*.tif") ; Check if the search was successful, if not write in the console a message and return False. If $hSearch = -1 Then _FileWriteLog(@ScriptDir & "\FAX_Handler_" & $date & ".log", "Non ci sono fax da spostare in archivio.") Return False EndIf ; Assign a Local variable the empty string which will contain the files names found. Local $sFileName = "", $iResult = 0 While 1 $sFileName = FileFindNextFile($hSearch) ; If there is no more file matching the search. If @error Then ExitLoop ; Forward the FAX via Mail $oOL = _OL_Open() _OL_Wrapper_SendMail($oOL, "xxxxx@gmail.com", "", "", "Subject: Test", "Body: Test", $FaxInboxDir&"\"&$sFileName) _OL_Close($oOL) ; Copy the fax file locally, on K:\ drive and write to the log. FileCopy($FaxInboxDir&"\"&$sFileName, $FaxLocalArchiveDir&"\"&$sFileName, $FC_OVERWRITE + $FC_CREATEPATH) FileMove($FaxInboxDir&"\"&$sFileName, $FaxArchiveDir, $FC_OVERWRITE + $FC_CREATEPATH) _FileWriteLog(@ScriptDir & "\FAX_Handler_" & $date & ".log", "Archiviato il file " & $sFileName) WEnd ; Close the search handle. FileClose($hSearch) EndFunc ;==>Example While 1 ArchiveFax() Sleep(10000) WEnd Link to comment Share on other sites More sharing options...
Developers Jos Posted May 13, 2016 Developers Share Posted May 13, 2016 Any hints as to where this information should come from? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. 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