Skip to content

Instantly share code, notes, and snippets.

View M0H4MM33D's full-sized avatar

M0H4MM33D M0H4MM33D

View GitHub Profile
@M0H4MM33D
M0H4MM33D / sendtomail.ps1
Created April 27, 2018 15:34
Send auto rapport cvs or txt or .. to mail using powershell (ATTACHMENT FILE).
$x=GET-Date
$t7en = "C:\Users\Administrateur\Desktop\rapport.csv"
$smtpServer = "smtp.gmail.com"
$sender = "EMAIL SERNDER"
$users = "EMAIL RCP";
$subject = "Rapport at $x"
$body = "By M0H4MM3D"
$message = new-object System.Net.Mail.MailMessage
$message.From = $sender
$message.To.Add($users)