<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How to send an email using a Windows Powershell script</title>
	<atom:link href="http://www.searchmarked.com/windows/how-to-send-an-email-using-a-windows-powershell-script.php/feed" rel="self" type="application/rss+xml" />
	<link>http://www.searchmarked.com/windows/how-to-send-an-email-using-a-windows-powershell-script.php</link>
	<description>I search, I bookmark, I write, You learn.</description>
	<lastBuildDate>Tue, 13 Dec 2011 08:27:48 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Paul</title>
		<link>http://www.searchmarked.com/windows/how-to-send-an-email-using-a-windows-powershell-script.php/comment-page-1#comment-1462</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Wed, 07 Dec 2011 13:06:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.searchmarked.com/windows/how-to-send-an-email-using-a-windows-powershell-script.php#comment-1462</guid>
		<description>Thanks, works great.
I try to mail to 5000 recipients, is there a way the script can read from a textfile or excell file. Then I can mail those people an attachment.

Thank you</description>
		<content:encoded><![CDATA[<p>Thanks, works great.<br />
I try to mail to 5000 recipients, is there a way the script can read from a textfile or excell file. Then I can mail those people an attachment.</p>
<p>Thank you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mahmoud</title>
		<link>http://www.searchmarked.com/windows/how-to-send-an-email-using-a-windows-powershell-script.php/comment-page-1#comment-1454</link>
		<dc:creator>mahmoud</dc:creator>
		<pubDate>Wed, 09 Nov 2011 00:12:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.searchmarked.com/windows/how-to-send-an-email-using-a-windows-powershell-script.php#comment-1454</guid>
		<description>or this way

$messageParameters = @{
 smtpServer = “smtphost”
From = md@yahoo.com
 To = md@yahoo.com
 Subject = “You Submitted a Job”
Body = “Your Job Chain is submitted successfully”
 }</description>
		<content:encoded><![CDATA[<p>or this way</p>
<p>$messageParameters = @{<br />
 smtpServer = “smtphost”<br />
From = <a href="mailto:md@yahoo.com">md@yahoo.com</a><br />
 To = <a href="mailto:md@yahoo.com">md@yahoo.com</a><br />
 Subject = “You Submitted a Job”<br />
Body = “Your Job Chain is submitted successfully”<br />
 }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mahmoud</title>
		<link>http://www.searchmarked.com/windows/how-to-send-an-email-using-a-windows-powershell-script.php/comment-page-1#comment-1453</link>
		<dc:creator>mahmoud</dc:creator>
		<pubDate>Wed, 09 Nov 2011 00:10:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.searchmarked.com/windows/how-to-send-an-email-using-a-windows-powershell-script.php#comment-1453</guid>
		<description>isn&#039;t this lighter and better ??

$messageParameters = @{
   smtpServer = &quot;smtphost&quot;
   From = [string]$from
   To = [string]$to
   Subject = &quot;You Submitted a Job&quot;
   Body = &quot;Your Job Chain is submitted successfully&quot;
}
Send-MailMessage @messageParameters -BodyAsHtml</description>
		<content:encoded><![CDATA[<p>isn&#8217;t this lighter and better ??</p>
<p>$messageParameters = @{<br />
   smtpServer = &#8220;smtphost&#8221;<br />
   From = [string]$from<br />
   To = [string]$to<br />
   Subject = &#8220;You Submitted a Job&#8221;<br />
   Body = &#8220;Your Job Chain is submitted successfully&#8221;<br />
}<br />
Send-MailMessage @messageParameters -BodyAsHtml</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darin</title>
		<link>http://www.searchmarked.com/windows/how-to-send-an-email-using-a-windows-powershell-script.php/comment-page-1#comment-1447</link>
		<dc:creator>Darin</dc:creator>
		<pubDate>Wed, 12 Oct 2011 17:04:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.searchmarked.com/windows/how-to-send-an-email-using-a-windows-powershell-script.php#comment-1447</guid>
		<description>Do you know of a way to set a reminder in Outlook using this script?  I&#039;m trying to send an smtp html email and have it automatically set a reminder for each of the users.

Thanks!</description>
		<content:encoded><![CDATA[<p>Do you know of a way to set a reminder in Outlook using this script?  I&#8217;m trying to send an smtp html email and have it automatically set a reminder for each of the users.</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anirudh</title>
		<link>http://www.searchmarked.com/windows/how-to-send-an-email-using-a-windows-powershell-script.php/comment-page-1#comment-1437</link>
		<dc:creator>anirudh</dc:creator>
		<pubDate>Fri, 16 Sep 2011 12:03:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.searchmarked.com/windows/how-to-send-an-email-using-a-windows-powershell-script.php#comment-1437</guid>
		<description>i have found the problem. i need to authenticate the sender to send mails to external domains.
the below script worked for me to send mails to external domains:
$emailFrom = “user@yourdomain.com”
$emailTo = “user@yourdomain.com”
$subject = “your subject”
$body = “your body”
$smtpServer = “your smtp server”
$smtp = new-object Net.Mail.SmtpClient($smtpServer)
$credentials=new-object system.net.networkcredential(&quot;domain\username&quot;,&quot;password&quot;)
$smtp.credentials=$credentials.getcredentials($smtpserver,&quot;portno(25 in my case)&quot;,&quot;authenticationtype(basic in my case)&quot;)
$smtp.Send($emailFrom, $emailTo, $subject, $body)</description>
		<content:encoded><![CDATA[<p>i have found the problem. i need to authenticate the sender to send mails to external domains.<br />
the below script worked for me to send mails to external domains:<br />
$emailFrom = “user@yourdomain.com”<br />
$emailTo = “user@yourdomain.com”<br />
$subject = “your subject”<br />
$body = “your body”<br />
$smtpServer = “your smtp server”<br />
$smtp = new-object Net.Mail.SmtpClient($smtpServer)<br />
$credentials=new-object system.net.networkcredential(&#8221;domain\username&#8221;,&#8221;password&#8221;)<br />
$smtp.credentials=$credentials.getcredentials($smtpserver,&#8221;portno(25 in my case)&#8221;,&#8221;authenticationtype(basic in my case)&#8221;)<br />
$smtp.Send($emailFrom, $emailTo, $subject, $body)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anirudh</title>
		<link>http://www.searchmarked.com/windows/how-to-send-an-email-using-a-windows-powershell-script.php/comment-page-1#comment-1436</link>
		<dc:creator>anirudh</dc:creator>
		<pubDate>Wed, 14 Sep 2011 15:45:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.searchmarked.com/windows/how-to-send-an-email-using-a-windows-powershell-script.php#comment-1436</guid>
		<description>i have tried sending mails to my gmail account using the first script but it didnt work it gave the following error:


Exception calling &quot;Send&quot; with &quot;4&quot; argument(s): &quot;Mailbox unavailable. The server response was: 5.7.1
 Unable to relay&quot;

Looking at the error i thougt it might work for sending mails to an internal address and yeah it worked.

is there a way i can modify the below script to use it to send mails to external domains:
$emailFrom = &quot;user@yourdomain.com&quot;
$emailTo = &quot;user@yourdomain.com&quot;
$subject = &quot;your subject&quot;
$body = &quot;your body&quot;
$smtpServer = &quot;your smtp server&quot;
$smtp = new-object Net.Mail.SmtpClient($smtpServer)
$smtp.Send($emailFrom, $emailTo, $subject, $body)</description>
		<content:encoded><![CDATA[<p>i have tried sending mails to my gmail account using the first script but it didnt work it gave the following error:</p>
<p>Exception calling &#8220;Send&#8221; with &#8220;4&#8243; argument(s): &#8220;Mailbox unavailable. The server response was: 5.7.1<br />
 Unable to relay&#8221;</p>
<p>Looking at the error i thougt it might work for sending mails to an internal address and yeah it worked.</p>
<p>is there a way i can modify the below script to use it to send mails to external domains:<br />
$emailFrom = &#8220;user@yourdomain.com&#8221;<br />
$emailTo = &#8220;user@yourdomain.com&#8221;<br />
$subject = &#8220;your subject&#8221;<br />
$body = &#8220;your body&#8221;<br />
$smtpServer = &#8220;your smtp server&#8221;<br />
$smtp = new-object Net.Mail.SmtpClient($smtpServer)<br />
$smtp.Send($emailFrom, $emailTo, $subject, $body)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: thb</title>
		<link>http://www.searchmarked.com/windows/how-to-send-an-email-using-a-windows-powershell-script.php/comment-page-1#comment-1424</link>
		<dc:creator>thb</dc:creator>
		<pubDate>Thu, 18 Aug 2011 07:37:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.searchmarked.com/windows/how-to-send-an-email-using-a-windows-powershell-script.php#comment-1424</guid>
		<description>great help!</description>
		<content:encoded><![CDATA[<p>great help!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Clayton</title>
		<link>http://www.searchmarked.com/windows/how-to-send-an-email-using-a-windows-powershell-script.php/comment-page-1#comment-1411</link>
		<dc:creator>Clayton</dc:creator>
		<pubDate>Tue, 21 Jun 2011 16:35:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.searchmarked.com/windows/how-to-send-an-email-using-a-windows-powershell-script.php#comment-1411</guid>
		<description>This script has come in handy.

I&#039;ve been using this on all my scripts to email myself the log files.</description>
		<content:encoded><![CDATA[<p>This script has come in handy.</p>
<p>I&#8217;ve been using this on all my scripts to email myself the log files.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bike Storage</title>
		<link>http://www.searchmarked.com/windows/how-to-send-an-email-using-a-windows-powershell-script.php/comment-page-1#comment-1404</link>
		<dc:creator>Bike Storage</dc:creator>
		<pubDate>Wed, 08 Jun 2011 06:05:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.searchmarked.com/windows/how-to-send-an-email-using-a-windows-powershell-script.php#comment-1404</guid>
		<description>Windows PowerShell is Microsoft&#039;s task automation framework, consisting of a command-line shell and associated scripting language built on top of, and integrated with the .NET Framework.</description>
		<content:encoded><![CDATA[<p>Windows PowerShell is Microsoft&#8217;s task automation framework, consisting of a command-line shell and associated scripting language built on top of, and integrated with the .NET Framework.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andbac</title>
		<link>http://www.searchmarked.com/windows/how-to-send-an-email-using-a-windows-powershell-script.php/comment-page-1#comment-1372</link>
		<dc:creator>Andbac</dc:creator>
		<pubDate>Thu, 31 Mar 2011 08:31:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.searchmarked.com/windows/how-to-send-an-email-using-a-windows-powershell-script.php#comment-1372</guid>
		<description>Perhaps abit late...but anyhow:

A note regarding the -Encoding parameter in the Send-MailMessage in the (V2) cmdlet: it  will not accept ASCII, UTF8 etc as value. One have to create a encoding object first like this (in my case UTF8):

$enc  = New-Object System.Text.utf8encoding

Which then can be used like this:

Send-MailMessage -to &quot;Firstname Lastname &quot; -From &quot;Firstname2 Lastname2 &quot; `
-Subject &quot;Test mail from PowerShell&quot; -Body &quot;Sending mail trough PowerShell V2 Send-MailMessage cmdlet&quot; `
-SmtpServer mailserver.domain.com -Encoding $enc</description>
		<content:encoded><![CDATA[<p>Perhaps abit late&#8230;but anyhow:</p>
<p>A note regarding the -Encoding parameter in the Send-MailMessage in the (V2) cmdlet: it  will not accept ASCII, UTF8 etc as value. One have to create a encoding object first like this (in my case UTF8):</p>
<p>$enc  = New-Object System.Text.utf8encoding</p>
<p>Which then can be used like this:</p>
<p>Send-MailMessage -to &#8220;Firstname Lastname &#8221; -From &#8220;Firstname2 Lastname2 &#8221; `<br />
-Subject &#8220;Test mail from PowerShell&#8221; -Body &#8220;Sending mail trough PowerShell V2 Send-MailMessage cmdlet&#8221; `<br />
-SmtpServer mailserver.domain.com -Encoding $enc</p>
]]></content:encoded>
	</item>
</channel>
</rss>

