Hello, I am looking to send myself a log file at the end of every month that shows my VPN connections for that month
Here it grabs the file and then sends it as an attachment. The file is 27MB The only problem is it always says:
At C:\VPNSCRIPT.ps1:3 char:1
+ Send-MailMessage -SMTPserver XXXXXXXXXX -From n ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.Mail.SmtpClient:SmtpClient) [Send-MailMessage], SmtpException
+ FullyQualifiedErrorId : SmtpException,Microsoft.PowerShell.Commands.SendMailMessage
$date = get-date -Format "IN15MM" Send-MailMessage -SMTPserver XXXXXXXXX -From XXX@XXXXX.com -Subject "VPN LOG" -To XXX@XXXXX.com -Attachments C:\$date.log