<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://powershell.com/cs/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results for 'app:forums' matching tags 'PowerShell' and 'Send mail'</title><link>http://powershell.com/cs/search/SearchResults.aspx?q=app:forums&amp;tag=PowerShell,Send+mail&amp;orTags=0&amp;o=DateDescending</link><description>Search results for 'app:forums' matching tags 'PowerShell' and 'Send mail'</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 (Build: 30929.2835)</generator><item><title>Powershell to send email with delivery notification enabled</title><link>http://powershell.com/cs/forums/thread/3680.aspx</link><pubDate>Wed, 28 Oct 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:3680</guid><dc:creator>smtpport25.wordpress</dc:creator><description>&lt;p&gt;Powershell to send email with delivery notification enabled. Once mail is delivered to the recipient mailbox and delivery notification mail will be sent to the sender mailbox. Below powershell help you to atchive the same&lt;/p&gt;
&lt;p&gt;$msg = new-object Net.Mail.MailMessage&lt;br /&gt;$smtp = new-object Net.Mail.SmtpClient($smtpServer)&lt;br /&gt;$msg.Headers.Add(&amp;quot;Disposition-Notification-To&amp;quot;, &amp;quot;from@domainname.com&amp;quot;)&lt;br /&gt;$msg.DeliveryNotificationOptions = &amp;quot;OnSuccess&amp;quot;&lt;br /&gt;$msg.From = &amp;ldquo;from@domainname.com&amp;rdquo;&lt;br /&gt;$msg.To.Add(&amp;rdquo;to@domainname.com&amp;rdquo;)&lt;br /&gt;$msg.Subject = &amp;ldquo;Subject&amp;rdquo;&lt;br /&gt;$msg.Body = &amp;ldquo;Body of the Message&amp;rdquo;&lt;br /&gt;$msg.Attachments.Add($att)&lt;br /&gt;$smtp.Send($msg)&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Krishna&lt;br /&gt;http://smtpport25.wordpress.com&lt;/p&gt;</description></item><item><title>Powershell script to send mail</title><link>http://powershell.com/cs/forums/thread/2628.aspx</link><pubDate>Mon, 01 Jun 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:2628</guid><dc:creator>smtpport25.wordpress</dc:creator><description>&lt;p&gt;&lt;a href="http://smtpport25.wordpress.com/2009/04/01/powershell-script-to-send-mail/"&gt;http://smtpport25.wordpress.com/2009/04/01/powershell-script-to-send-mail/&lt;/a&gt;&lt;/p&gt;
&lt;div class="snap_preview"&gt;
&lt;p&gt;Below Powershell script can be used to send mail using SMTP server. It reads every line from the text file and adds to the body of the email and sent it.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;$emailFrom = &amp;ldquo;Fromaddress&amp;rdquo;&lt;br /&gt;&amp;nbsp;$emailTo = &amp;ldquo;Toaddress&amp;rdquo;&lt;br /&gt;&amp;nbsp;$sub = Date&lt;br /&gt;&amp;nbsp;$subject = &amp;ldquo;Subject &amp;rdquo; + $sub&lt;br /&gt;&amp;nbsp;$UserList = Get-Content &amp;ldquo;C:\Details.txt&amp;rdquo;&lt;br /&gt;&amp;nbsp;$body = &amp;ldquo;&amp;rdquo;&lt;br /&gt;&amp;nbsp;foreach($user in $UserList)&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;$body = $body + $user + &amp;ldquo;`n&amp;rdquo; # &amp;lsquo;n represents the new line escape sequence&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;$smtpServer = &amp;ldquo;SMTPServer&amp;rdquo;&lt;br /&gt;&amp;nbsp;$smtp = new-object Net.Mail.SmtpClient($smtpServer)&lt;br /&gt;&amp;nbsp;$smtp.Send($emailFrom, $emailTo, $subject, $body)&lt;/p&gt;
&lt;/div&gt;</description></item></channel></rss>