Whilst it may seem a bit elaborate to call a batch file which calls a PowerShell script to send an email, as far as I’m aware this is the easiest way to receive email notifications from FileZilla. Powershell has what’s called an Execution Policy (read the Execution Policy TechNet documentation for more info) so for this to work you must set it to Unrestricted before any of the above will work by running the following command in an Administrative PowerShell prompt (Right-click on PowerShell > Run as Administrator): Set-ExecutionPolicy UnrestrictedĪlso, on a 64-bit machine, “Powershell” and “Powershell(x86)” are two separate applications with independent Execution Policies! In my tests the 32-bit version was called by the batch script, but you may as well set the execution policy for both. Then, you simply tell FileZilla to run the batch script when all transfers are complete. ![]() What’s Happening?įirst we wrote a PowerShell script which sends an email through Google’s SMTP servers, but FileZilla can’t run it directly so you must make a batch file which can. Now when the queue is complete the email specified in Step 3 will be sent. Enter the following line in the popup: C:\fn\fn.batĨ. Right-click in the whitespace in the bottom panel > “Action after queue completion” > Run command…ħ. Open FileZilla and start an upload/downloadĦ. Open fn.bat and enter the following: powershell "C:\fn\fn.ps1"ĥ. $SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body)Ĥ. $SMTPClient.Credentials = New-Object ("GMAIL_ADDRESS", "GMAIL_PASSWORD") $SMTPClient = New-Object ($SmtpServer, 587) Open fn.ps1 in your text editor and enter the following: Create two files in this folder called “fn.bat” and “fn.ps1”ģ. ![]() Create a folder on your C: drive called “fn”Ģ. A Google account (make a new one at /SignUp because you’ll be storing the password in plaintext)ġ.A text editor (notepad will suffice, but Sublime Text is my editor-of-choice).PowerShell (ships with Windows 7 - download PowerShell if you’re still using XP). ![]() Setting up email notifications when a FileZilla queue finishes is super-easy and this article will explain how to do it in a Windows environment.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |