Centmin Mod LEMP stack already installs mailx and mail commands so this is very useful guide by folks at Tecmint 4 Ways to Send Email Attachment from Linux Command Line :)