<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.1701technology.com/index.php?action=history&amp;feed=atom&amp;title=Powerhsell_Send_Email_Using_Outlook</id>
	<title>Powerhsell Send Email Using Outlook - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.1701technology.com/index.php?action=history&amp;feed=atom&amp;title=Powerhsell_Send_Email_Using_Outlook"/>
	<link rel="alternate" type="text/html" href="https://wiki.1701technology.com/index.php?title=Powerhsell_Send_Email_Using_Outlook&amp;action=history"/>
	<updated>2026-05-06T14:39:58Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.1701technology.com/index.php?title=Powerhsell_Send_Email_Using_Outlook&amp;diff=995&amp;oldid=prev</id>
		<title>Michael.mast: Created page with &quot;==Purpose== Use Outlook to send email on behalf of user running the script, instead of using smtp. ==Example== &lt;ref&gt;https://blogit.create.pt/andresilva/2017/12/07/sending-an-e...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.1701technology.com/index.php?title=Powerhsell_Send_Email_Using_Outlook&amp;diff=995&amp;oldid=prev"/>
		<updated>2018-11-06T20:25:12Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Purpose== Use Outlook to send email on behalf of user running the script, instead of using smtp. ==Example== &amp;lt;ref&amp;gt;https://blogit.create.pt/andresilva/2017/12/07/sending-an-e...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Purpose==&lt;br /&gt;
Use Outlook to send email on behalf of user running the script, instead of using smtp.&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;ref&amp;gt;https://blogit.create.pt/andresilva/2017/12/07/sending-an-email-with-attachments-using-outlook-and-powershell/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$file=&amp;quot;$ENV:userprofile\Desktop\$samaccountname.csv&amp;quot;&lt;br /&gt;
try { $body | Export-Csv -LiteralPath $file -NoTypeInformation } catch {clear; echo &amp;quot;Failed to create file, let IT know this failed&amp;quot;; pause; exit}&lt;br /&gt;
&lt;br /&gt;
$outlook = New-Object -ComObject Outlook.Application&lt;br /&gt;
$mail = $outlook.CreateItem(0)&lt;br /&gt;
$mail.subject = &amp;quot;New User $samaccountname&amp;quot;&lt;br /&gt;
$mail.body = &amp;quot;See attached for user properties&amp;quot;&lt;br /&gt;
$mail.to = &amp;quot;someone@somewhere.com&amp;quot;&lt;br /&gt;
$mail.attachments.add($file)&lt;br /&gt;
try {&lt;br /&gt;
$mail.send()&lt;br /&gt;
&lt;br /&gt;
} catch {clear; echo &amp;quot;Failed to send email, let IT know this failed&amp;quot;; pause; exit}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Michael.mast</name></author>
		
	</entry>
</feed>