Send email from Powershell with attachment

Posted by: SQL Server DBA, on 07 Feb 2012 | View original | Bookmarked: 0 time(s)

This post  describes how to call  to add an email attachment using Powershell. In an earlier post - SQL Server Send email using Powershell the new-object Net.Mail.SmtpClient() Class was used. To add an email attachment , use New-Object System.Net.Mail.MailMessage and New-Object System.Net.Mail.Attachment, which are part of the .Net Framework The example script includes creating the variables, the function and calling the function .   $emailFrom = "jvamvas@sqlserver-dba.com" $emailTo...

Advertisement
Free Agile Project Management Tool from Telerik
TeamPulse Community Edition helps your team effectively capture requirements, manage project plans, assign and track work, and most importantly, be continually connected with each other.
Category: SQL | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 382 | Hits: 14

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD