Posts

Showing posts from July, 2021

How to send Email using command in Windows

Image
You can not use Command Prompt directly to send an email, but using PowerShell allows you to use the underlying .Net Framework, you can easily create and send an  e-mail from the command line.  #this works, just sends a simple email $smtpServer = "your.webmailserver.com" $smtpFrom = "fromadress@webmailserver.com" $smtpTo = "todaddress@webmailserver.com" $smtpCc = 'ccdaddress@webmailserver.com' $smtpSubject = "This is a test email" $username = "username" $password = "password" $body = "your mail body goes here" $smtp = New-Object -TypeName "Net.Mail.SmtpClient" -ArgumentList $smtpServer $smtp.Credentials = New-Object system.net.networkcredential($username, $Password); $smtpBody = $body $SMTPMessage = New-Object System.Net.Mail.MailMessage($smtpFrom, $smtpTo, $smtpSubject, $smtpBody) $SMTPMessage.cc.Add($smtpCc) $SMTPMessage.IsBodyHTML=$true $smtp.Send($SMTPMessage) You can run this sc

How to take MySql backup with schedule and success and failure notification

Image
  Following script can be used to take MySql Backup: @echo on For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%b-%%a-%%c) For /f "tokens=1-2 delims=/:" %%a in ('time /t') do (set mytime=%%a-%%b) mysqldump --protocol=TCP -P8081 -uusername -ppassword databasename> "C:\backup\backupfilename_%mydate%_%mytime%.sql" if %ERRORLEVEL%==0 ( //Send your success notification ) else if %ERRORLEVEL%==2 ( //Send your failure notification ) Here first two line is to get date and time after that we use mysqldump to backup the database, providing protocol, username, password and database name and phisical address of the backup file. See mysqldump documentation for more information.  After backup process completed ERRORLEVEL variable contains the status of the backup if backup is success the value will be 0, for error it will be 2 and if there is any warning then 1. So you can easily send the

A good VS code extension for MS Dynamics 365 Business Central AL Development

Image
  As we know Microsoft has moved the D365 Business Central development environment to VS code. In the Dynamics NAV which was in the native development tools. Now everything is code based and no visual tools are there for object navigation and table, page or report creation.  The good news is I have found a nice extension in VS Code which will be very helpful for the developers.  Name of the extension is  AZ AL Dev Tools/AL Code Outline for Visual Studio Code ( Visit Marketplace ) It has features like: AL objects wizards Symbols browser AL symbols outline panel Symbols tree view AL code generators Code actions Code transformation commands Action images browser Custom editors Documentation comments support Code analyzers rules viewer Document syntax visualizer Also you can use the extension to create the objects (table pages etc.) visually like previous and it will auto generate AL code for the objects: These are the wizards to create new AL object file: Table Wizard Table Extension Wiza