techjunkie.tv

powershell tips, ccna tips, tech videos, learn tech

Posts Tagged ‘sending email with powershell’

How to Backup A Sybase Database With Powershell and Send Syslog MEssage With Powershell —

#Scott Alvarino #01/28/2011 Version 3 #This is script to backup Sybase db to 2 other different locations. #It also notifies the user through email, plus leaves a syslog message and a winEvent message. #add-pssnapin NetCmdlets # Remove the comment if pssnapin is not in the PS profile #Variables Section That is configureable $ftptimeframemin =”-8change_me” #How [...]

How to Send a file by email using Gmail and Powershell —

How do you send a file using Powershell 2.0 and a gmail account? Answer: $filename = “c:\scripts_scott\test9999.xls” $smtpserver = “smtp.gmail.com” $msg = new-object Net.Mail.MailMessage $att = new-object Net.Mail.Attachment($filename) $smtp = new-object Net.Mail.SmtpClient($smtpServer ) $smtp.EnableSsl = $True $smtp.Credentials = New-Object System.Net.NetworkCredential(“username”, “password_here”); # Put username without the @GMAIL.com or – @gmail.com $msg.From = “username@gmail.com” $msg.To.Add(”boss@job.com”) $msg.Subject [...]