how to send mail and attachment using powershell

C++
$file = "C:\folder\file.csv"
$att = new-object Net.Mail.Attachment($file)
Source

Also in C++: