<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mitch Milam&#039;s Dynamics CRM and xRM Discussions &#187; Email</title>
	<atom:link href="http://blogs.infinite-x.net/category/dynamics-crm/email/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.infinite-x.net</link>
	<description>Sharing information with Dynamics CRM users and xRM developers</description>
	<lastBuildDate>Wed, 08 Feb 2012 16:27:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Using the DeliverIncomingEmail Message</title>
		<link>http://blogs.infinite-x.net/2010/03/31/using-the-deliverincomingemail-message/</link>
		<comments>http://blogs.infinite-x.net/2010/03/31/using-the-deliverincomingemail-message/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 15:37:07 +0000</pubDate>
		<dc:creator>Mitch Milam</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Dynamics CRM]]></category>
		<category><![CDATA[Email]]></category>

		<guid isPermaLink="false">http://blogs.infinite-x.net/2010/03/31/using-the-deliverincomingemail-message/</guid>
		<description><![CDATA[Every now and again, you find an absolute gem within the CRM SDK.&#160; And Iâ€™m not talking about a diamond-in-the-rough, Iâ€™m talking about a bright, shiny, put it in a ring kind. The DeliverIncomingEmail message is one of those gems.&#160; Letâ€™s take a look: &#160; What does it do? First and foremost, it takes information [...]]]></description>
			<content:encoded><![CDATA[<p>Every now and again, you find an absolute gem within the CRM SDK.&#160; And Iâ€™m not talking about a diamond-in-the-rough, Iâ€™m talking about a bright, shiny, put it in a ring kind.</p>
<p>The <strong>DeliverIncomingEmail</strong> message is one of those gems.&#160; Letâ€™s take a look:</p>
<p>&#160;</p>
<h3>What does it do?</h3>
<p>First and foremost, it takes information that exists within an email message that you retrieved from somewhere and creates a CRM Email Activity. This process could be a custom application you wrote, or in my case, a <a href="http://blogs.infinite-x.net/2010/03/27/creating-your-own-email-router-for-crm-4/" target="_blank">Simple Email Router</a>.&#160; Regardless of where the email comes from, this message will do all of the heavy lifting required to create the Email Activity.</p>
<p>&#160;</p>
<h3>Usage:</h3>
<pre class="code"><span style="color: #2b91af">DeliverIncomingEmailRequest </span>request = <span style="color: blue">new </span><span style="color: #2b91af">DeliverIncomingEmailRequest
</span>{
    Subject = subject,
    From = from,
    To = to,
    Cc = cc,
    Bcc = bcc,
    MessageId = <span style="color: #2b91af">Guid</span>.NewGuid().ToString(),
    ReceivedOn = <span style="color: #2b91af">CrmTypes</span>.CreateCrmDateTimeFromUser(timeReceived),
    Body = body,
    SubmittedBy = to,
    Importance = <span style="color: #a31515">&quot;Normal&quot;</span>,
    Attachments = <span style="color: blue">new </span><span style="color: #2b91af">BusinessEntityCollection</span>()
};

request.Attachments.EntityName = <span style="color: #2b91af">EntityName</span>.activitymimeattachment.ToString();
request.Attachments.BusinessEntities.Add(<span style="color: blue">new </span><span style="color: #2b91af">activitymimeattachment</span>());</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<h3>&#160;</h3>
<h3>How It Works</h3>
<p>You complete the parameters of the message with information from the inbound email; things like To, From, Subject, Body, etc. the use the CrmService.Execute method to deliver the mail.&#160; Thatâ€™s it.</p>
<p>&#160;</p>
<h3>Caveats</h3>
<p><strong>MessageId</strong> is a Guid that can be either the ID of the message or a new Guid you supply.</p>
<p><strong>Attachments</strong> are required, even if you donâ€™t have attachments.&#160; In the example above, we have created a BusinessEntityCollection to hold our attachments, but never actually added any.&#160; This will keep the Message from failing to process.</p>
<p><strong>To</strong>, <strong>Cc</strong>, <strong>Bcc</strong> can contain multiple email addresses that are separated by a comma ( , ).</p>
<p>&#160;</p>
<h3>So why is this such a big deal?</h3>
<p>Did you notice that we are only supplying the email addresses of the people involved in the conversation?&#160; When CRM processes this message, it will perform an automatic lookup and attempt to associate people with those email addresses.</p>
<p>This is actually one of the few messages within the CRM SDK that doesnâ€™t require an ID to perform a lookup or an association and saves you, the developer, a tremendous amount of time and effort.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.infinite-x.net/2010/03/31/using-the-deliverincomingemail-message/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating your own email router for CRM 4</title>
		<link>http://blogs.infinite-x.net/2010/03/27/creating-your-own-email-router-for-crm-4/</link>
		<comments>http://blogs.infinite-x.net/2010/03/27/creating-your-own-email-router-for-crm-4/#comments</comments>
		<pubDate>Sat, 27 Mar 2010 16:27:39 +0000</pubDate>
		<dc:creator>Mitch Milam</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Dynamics CRM]]></category>
		<category><![CDATA[Email]]></category>

		<guid isPermaLink="false">http://blogs.infinite-x.net/2010/03/27/creating-your-own-email-router-for-crm-4/</guid>
		<description><![CDATA[Yes, I said Email Router.&#160; And no, Iâ€™m mostly not crazy â€“ I just had a very specific need to fulfill and I didnâ€™t wish to install the standard CRM Email Router to solve a problem. A Bit of Background In the next few weeks, sometime before Convergence 2010, Iâ€™ll be launching a new online [...]]]></description>
			<content:encoded><![CDATA[<p>Yes, I said Email Router.&#160; And no, Iâ€™m mostly not crazy â€“ I just had a very specific need to fulfill and I didnâ€™t wish to install the standard CRM Email Router to solve a problem.</p>
<h2>A Bit of Background</h2>
<p>In the next few weeks, sometime before Convergence 2010, Iâ€™ll be launching a new online training service for CRM users.&#160; This is a totally Online-based solution using the Microsoft Online stack including:</p>
<ul>
<li>CRM Online</li>
<li>Business Productivity Online Suite ( BPOS )</li>
<li>Windows Azure</li>
</ul>
<p>The only drawback to using CRM Online is you must install the CRM Email Router on a computer somewhere to move email into and out of CRM Online.&#160; Since I wanted everything in a data center <em>not</em> run by me, I decided to spend a little time and effort to create a very simplistic replacement for the Email Router.</p>
<p>&#160;</p>
<h2>Email Router Architecture</h2>
<p>At its heart, the Email Router really only does two things:</p>
<ol>
<li>Check CRM for unsent messages, sending any it finds</li>
<li>Check a mailbox for new messages, retrieving and inserting into CRM any it finds</li>
</ol>
<p>That didnâ€™t seem to be too hard of a process to replicate especially since, in all reality, I only had one CRM user to monitor.</p>
<p>&#160;</p>
<h3>Software Components</h3>
<p>To help me send and receive email, I selected the <a href="http://www.chilkatsoft.com/email-dotnet.asp" target="_blank">Chilkat Email .NET Component</a>.&#160; Itâ€™s quite affordable and has a whole host of useful features.</p>
<p>Everything else was written using the <a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=82e632a7-faf9-41e0-8ec1-a2662aae9dfb" target="_blank">CRM SDK</a>.</p>
<p>The code resides inside a Windows Azure Worker Role and I poll CRM and the Exchange Online mailbox a few times a minute ( again, this is not a high-production environment ).</p>
<p>&#160;</p>
<h3>Sending Email</h3>
<p>So how do you determine what email needs to get sent?&#160; Itâ€™s pretty simple actually:&#160; You just query the Email entity and look for emails with a <a href="http://msdn.microsoft.com/en-us/library/bb955600.aspx" target="_blank">statuscode</a> attribute for a value of 6, which is <strong>PendingSend</strong>.</p>
<p>Again, I donâ€™t have complicated requirements so Iâ€™m only interested in retrieving the TO, Subject, and Description from the email.&#160; If my needs develop, I can always add additional functionality to handle scenarios like:</p>
<ul>
<li>Multiple recipients</li>
<li>Attachments</li>
<li>Multiple users ( From address )</li>
</ul>
<p>Once I have collected all of the emails to be sent, I connect to Exchange Online, send the emails, then set the status of the email to <strong>Sent</strong></p>
<p><strong></strong></p>
<h3><strong>Receiving Email</strong></h3>
<p>Collecting incoming email is a very similar process.&#160; Hereâ€™s how it works:</p>
<ol>
<li>I connect to my Exchange Online mailbox using POP3 and retrieve all of the unread email.</li>
<li>Looping through each email, I use the SDK method, <a href="http://msdn.microsoft.com/en-us/library/bb956021.aspx" target="_blank">DeliverIncomingEmailRequest</a>, to actually deliver the email to CRM.</li>
<li>After successful delivery, I delete the email from the Exchange Online mailbox.</li>
</ol>
<p>
<h2></h2>
</p>
<p>
<h2>Conclusion</h2>
</p>
<p>
<p>Well, thatâ€™s about it.&#160; Like I mentioned numerous times: my needs were very simplistic, but as you can see, itâ€™s not rocket science, and the process can be enhanced and extended to suit your needs.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.infinite-x.net/2010/03/27/creating-your-own-email-router-for-crm-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Outlook 2007 and Plain Text Email Line Wrapping</title>
		<link>http://blogs.infinite-x.net/2009/09/02/outlook-2007-and-plain-text-email-line-wrapping/</link>
		<comments>http://blogs.infinite-x.net/2009/09/02/outlook-2007-and-plain-text-email-line-wrapping/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 03:29:08 +0000</pubDate>
		<dc:creator>Mitch Milam</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Email]]></category>

		<guid isPermaLink="false">http://blogs.infinite-x.net/2009/09/02/outlook-2007-and-plain-text-email-line-wrapping/</guid>
		<description><![CDATA[This is a bit off-topic for me, but since I ran into it, I blog about it. So Iâ€™m testing one of my CRM add-ons which involves sending an email to an email-enabled CRM queue. Iâ€™m sending an email with an XML packet in the email body.&#160; Unfortunately, Outlook keeps hard-wrapping the text by inserting [...]]]></description>
			<content:encoded><![CDATA[<p>This is a bit off-topic for me, but since I ran into it, I blog about it.</p>
<p>So Iâ€™m testing one of my CRM add-ons which involves sending an email to an email-enabled CRM queue.</p>
<p>Iâ€™m sending an email with an XML packet in the email body.&#160; Unfortunately, Outlook keeps hard-wrapping the text by inserting carriage-returns which end up breaking the XML into fragments.</p>
<p>Fortunately, <a href="http://www.slipstick.com/index.htm" target="_blank">Slipstick Systems</a> came to my rescue, as always ( anything Outlook/Exchange-related ).</p>
<p>Anyway, I found a reference to a <a href="http://support.microsoft.com/?id=823921" target="_blank">KB article</a> that mentions how to make Outlook â€œnot wrapâ€? plain text emails going out over the Internet.</p>
<p>Perfect!</p>
<p>Other than having to change the Registry Key mentioned in the KB article to:</p>
<blockquote><p>HKEY_CURRENT_USER\Software\Microsoft\Office\12.0</p>
</blockquote>
<p>instead of Office\11.0 ( for Outlook 2003 ), everything worked and I can get back to testing.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.infinite-x.net/2009/09/02/outlook-2007-and-plain-text-email-line-wrapping/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Solving an undeliverable mail issue with CRM 3.0</title>
		<link>http://blogs.infinite-x.net/2008/03/18/solving-an-undeliverable-mail-issue-with-crm-30/</link>
		<comments>http://blogs.infinite-x.net/2008/03/18/solving-an-undeliverable-mail-issue-with-crm-30/#comments</comments>
		<pubDate>Tue, 18 Mar 2008 20:56:12 +0000</pubDate>
		<dc:creator>Mitch Milam</dc:creator>
				<category><![CDATA[Dynamics CRM]]></category>
		<category><![CDATA[Email]]></category>

		<guid isPermaLink="false">http://blogs.infinite-x.net/2008/03/18/solving-an-undeliverable-mail-issue-with-crm-30/</guid>
		<description><![CDATA[I ran into an interesting issue yesterday at one of my customers.&#160; They have two CRM servers and a forwarding mailbox for each server.&#160; The setup looks like this: &#160; &#160; We had an issue with the second CRM server, which just went into production, where inbound mail wasn&#039;t being sent to CRM.&#160; Looking at [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into an interesting issue yesterday at one of my customers.&#160; They have two CRM servers and a forwarding mailbox for each server.&#160; The setup looks like this:</p>
<p>&#160;</p>
<p><a href="http://blogs.infinite-x.net/images/SolvinganundeliverablemailissuewithCRM.0_E016/CRMsetup1.jpg"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="447" alt="CRMsetup1" src="http://blogs.infinite-x.net/images/SolvinganundeliverablemailissuewithCRM.0_E016/CRMsetup1_thumb.jpg" width="325" border="0" /></a> </p>
<p>&#160;</p>
<p>We had an issue with the second CRM server, which just went into production, where inbound mail wasn&#039;t being sent to CRM.&#160; Looking at the forwarding mailbox, we found that all of the mail had ended up in the Undeliverable folder.&#160; After a couple of hours of troubleshooting and searching the web, I found this <a href="http://geekswithblogs.net/guentersblog/archive/2006/05/23/79326.aspx">article</a> from Guenter that provided the solution to our issue.</p>
<p>It turns out the CRM Email Router service was running under the security context of a user called CRMMail.&#160; We had to add that user to the PrivUserGroup security group for the second CRM server so that it would accept the forwarded email.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.infinite-x.net/2008/03/18/solving-an-undeliverable-mail-issue-with-crm-30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring the CRM 4.0 email router to use a POP3 account</title>
		<link>http://blogs.infinite-x.net/2008/01/22/configuring-the-crm-40-email-router-to-use-a-pop3-account/</link>
		<comments>http://blogs.infinite-x.net/2008/01/22/configuring-the-crm-40-email-router-to-use-a-pop3-account/#comments</comments>
		<pubDate>Tue, 22 Jan 2008 14:42:24 +0000</pubDate>
		<dc:creator>Mitch Milam</dc:creator>
				<category><![CDATA[Dynamics CRM]]></category>
		<category><![CDATA[Email]]></category>

		<guid isPermaLink="false">http://blogs.infinite-x.net/2008/01/22/configuring-the-crm-40-email-router-to-use-a-pop3-account/</guid>
		<description><![CDATA[[via Vollmer] Michael Lu has a really cool video showing how to configure the CRM 4.0 email router to use a POP3 account.]]></description>
			<content:encoded><![CDATA[<p>[via <a href="http://blogs.msdn.com/midatlanticcrm/archive/2008/01/21/the-microsoft-crm-4-0-e-mail-router-with-pop3.aspx" target="_blank">Vollmer</a>]</p>
<p>Michael Lu has a really cool <a href="http://www.mikelu.org/archives/176" target="_blank">video</a> showing how to configure the CRM 4.0 email router to use a POP3 account.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.infinite-x.net/2008/01/22/configuring-the-crm-40-email-router-to-use-a-pop3-account/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

