<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.aras.com/community/cfs-file/__key/system/syndication/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>Graphics in an Email</title><link>https://www.aras.com/community/f/development/9184/graphics-in-an-email</link><description>Hi, 
 
 I want to send an Email from Aras, but with some graphics included. It would typically be a bitmap or svg from the vault. 
 .....My guess would be that one would use C# to first copy the picture to somewhere on the server. 
 But can one include</description><dc:language>ja-JP</dc:language><generator>Telligent Community 12</generator><item><title>RE: Graphics in an Email</title><link>https://www.aras.com/community/thread/4513?ContentTypeID=1</link><pubDate>Wed, 04 Mar 2020 12:49:28 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:152ae570-3cd8-4bd8-ade0-e3f3c02d12d1</guid><dc:creator>Riaan H</dc:creator><description>&lt;p&gt;Thanks C, I did expect at least svg compatibility.&amp;nbsp; But I did not know about the cid possibility. I will investigate....&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Graphics in an Email</title><link>https://www.aras.com/community/thread/4512?ContentTypeID=1</link><pubDate>Wed, 04 Mar 2020 12:46:34 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:71c4faa9-6b6e-4071-aa72-de315dfe27eb</guid><dc:creator>Riaan H</dc:creator><description>&lt;p&gt;Thanks Angela, I had inline in mind. I will investigate the base64 option, but the blocking of images is something to take note off.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Graphics in an Email</title><link>https://www.aras.com/community/thread/4510?ContentTypeID=1</link><pubDate>Wed, 04 Mar 2020 11:03:50 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:cfce6e88-e364-4e49-a5e3-0e92463f621e</guid><dc:creator>cogres</dc:creator><description>&lt;p&gt;Hi Riaan,&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think it is possible to include attachments in the Aras mail templates, unfortunately. &lt;br /&gt;So you would have to send the Email form a server method using, for example, the MailMessage, Attachment and SmtpClient classes in System.Net.Mail.&lt;br /&gt;If you had hoped to simply include the svg in the HTML (a reasonable hope), &lt;a href="https://css-tricks.com/a-guide-on-svg-support-in-email/"&gt;that is not widely supported&lt;/a&gt;. So you would have to add the image as an attachment to the email and then reference that attachment in the HTML using its content ID (cid). Here&amp;#39;s an example of what such an Aras method could look like (obviously the settings would have to be adjusted for your setup, SMTP server and security requirements):&lt;br /&gt;&lt;br /&gt; &lt;code&gt;
const string toEmailAddress = &amp;quot;a.bc@abc.com&amp;quot;;&lt;br /&gt;
const string fromEmailAddress = &amp;quot;x.yz@xyz.com&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
const string contentId = &amp;quot;myImageId&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var message = new System.Net.Mail.MailMessage(fromEmailAddress, toEmailAddress)&lt;br /&gt;
{&lt;br /&gt;&amp;nbsp;&amp;nbsp;
    Subject = &amp;quot;An Email Subject&amp;quot;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;
    Body = $&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;This is an &amp;lt;img src=\&amp;quot;cid:{contentId}\&amp;quot; /&amp;gt; embedded image.&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;
    IsBodyHtml = true&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
var attachment =&lt;br /&gt;&amp;nbsp;&amp;nbsp;
    new System.Net.Mail.Attachment(@&amp;quot;PathToSomeFolderOnServerWithSomeImage\SomeImage.jpg&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;
    {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
        ContentId = contentId&lt;br /&gt;&amp;nbsp;&amp;nbsp;
    };&lt;br /&gt;
message.Attachments.Add(attachment);&lt;br /&gt;
&lt;br /&gt;
var client = new System.Net.Mail.SmtpClient&lt;br /&gt;
{&lt;br /&gt;&amp;nbsp;&amp;nbsp;
    Host = &amp;quot;smtp.server.com&amp;quot;,&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;
    Port = 123, &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;
    UseDefaultCredentials = true,&lt;br /&gt;&amp;nbsp;&amp;nbsp;
    EnableSsl = true,&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;
    Credentials = new NetworkCredential(&amp;quot;x.yz@xyz.com&amp;quot;, &amp;quot;passwordForThatUser&amp;quot;)&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
client.Send(message);&lt;br /&gt;
&lt;br /&gt;
return this;
        
    &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Hope this helps,&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;C&lt;code&gt;&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Graphics in an Email</title><link>https://www.aras.com/community/thread/4507?ContentTypeID=1</link><pubDate>Wed, 04 Mar 2020 07:47:40 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:16ec9f3c-a7d0-4508-b9f1-0ab54c9e9d7b</guid><dc:creator>AngelaIp</dc:creator><description>&lt;p&gt;Do you want to add the picture as attachment or as inline image? For inline images you could convert your image to a base64 string that you then can add as regular email content. But in reality these images will often be blocked by email programs.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>