You are on page 1of 1

1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11:

$filename = c:\temp\profile.ps1 $smtpServer = server-name or IP $msg = new-object Net.Mail.MailMessage $att = new-object Net.Mail.Attachment($filename) $smtp = new-object Net.Mail.SmtpClient($smtpServer) $msg.From = who@from.com $msg.To.Add(who@to.com) $msg.Subject = Email Subject $msg.Body = Body of email goes here. $msg.Attachments.Add($att) $smtp.Send($msg)

You might also like