Hi,
Thanks for your reply.
techhelp.santovec.us/decode.htm
www.outlookcode.com/.../htmlimg.htm Using this link also helpful for me to understand MIME and outlook embedded image.
Now I can download embedded images to Server side from MIME (I used Chilkat.dll for email).
Below is sample code for downloading image and it is working.
Chilkat.Mime mime = new Chilkat.Mime();
mime.UnlockComponent("Anything for 30-day trial.");
mime.LoadMime(email.GetMime());
for (int x = 0; x < mime.NumParts; x++)
{
if (mime.GetPart(x) != null)
{
if (email.GetRelatedContentType(x) != null)
{
string[] str = email.GetRelatedContentType(x).ToString().Split('/');
if (str.Length > 1)
{ //mime.GetPart(x).SaveBody(AppDomain.CurrentDomain.BaseDirectory.ToString() + "ClientBin\img\" + email.GetRelatedFilename(x) + "." + str[1]); //output : F:\XYZ\Com.Server.Web\ClientBin\img\image001.gif
string path = System.Web.HttpContext.Current.Server.MapPath("~/img");
mime.GetPart(x).SaveBody(path + email.GetRelatedFilename(x) + "." + str[1]);
}}}}
I tried to get image path these way (I used ComponentOne C1RichtextBox)
1) string hostName = Application.Current.Host.Source.Host;
2) string serverPath = AppDomain.CurrentDomain.BaseDirectory;
3) string url = App.Current.Host.Source.ToString
Replace old path to new path this way.
void OnConvertingHtmlNode(object sender, C1.Silverlight.RichTextBox.Documents.ConvertingHtmlNodeEventArgs e)
{
var element = e.HtmlNode as C1.Silverlight.RichTextBox.Documents.C1HtmlElement;
if (element != null && element.Name == "img")
{
string src;
if (element.Attributes.TryGetValue("src", out src) && src.StartsWith("cid:"))
{
src = src.Remove(0, 4);
string[] temp = src.Split('@');
string path = System.IO.Path.GetDirectoryName(App.Current.Host.Source.ToString().Remove(App.Current.Host.Source.ToString().Length - 17)).Replace("\", "//") + "/Images/";
element.Attributes["src"] = path + App.CurrentUser.UserId.ToString() + temp[0];
} } }
Thanks,
Gaurang