Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

How to embed image in SharePoint custom email using SPUtility.SendEmail?

$
0
0

I used the below code to send custom email messages from SharePoint. This contains an image be displayed in email body. Unfortunately outlook does not display it by default. Please advise if there is another means of embedding/encoding the image to display as part of email body

string html = @"
</head>
<p><strong>" + item.Name.ToString() + "</strong> has been " + eventType + @"</p>
<table style=""width: 100%"" class=""style2"">
    <tr>
        <td style=""width: 25%"" class=""style1"">
            <a href=" + webPath + @"/_layouts/mysubs.aspx>Modify my Settings</a></td>
        <td style=""width: 25%"" class=""style1""><a href=" + FullPath + ">View THIS " + item.Name + @"</a></td>
        <td style=""width: 25%"" class=""style1""><a href=" + ListPath + ">View THIS " + list.Title + @"</a></td>
<td>
<img src=""https://webapp1/SiteCollectionImages/tseer.png"" width=""795"" height=""200""/>
</td>
    </tr>
</table>";
string subject = list.Title.ToString();
SPUtility.SendEmail(web, true, false,  ahp.headers["to"].ToString(), subject, css + html);


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>