Free Support Forum - aspose.com

Msg file to tiff conversion with complete email address

Hi Team,

Currently i am converting msg file to tiff image.
But i need to show the complete sender address in the converted image. Is there any option to show complete address in the converted tiff image.

Please see the code which i am using

  MemoryStream msgStream = null;
MailMessage msg = null;
Document msgDocument = null;
        <span style="color:#2b91af;">MultiPageTiffConverterUtil</span> m = <span style="color:blue;">new</span> <span style="color:#2b91af;">MultiPageTiffConverterUtil</span>();
        <span style="color:blue;">string</span> TiffFileName = <span style="color:blue;">string</span>.Empty;

        <span style="color:blue;">try</span>
        {

            <span style="color:blue;">string</span> FullconvertedMultiTiffName = <span style="color:blue;">string</span>.Empty;
                    
            <span style="color:green;">// load the MSG file using Aspose.Network for .NET</span>
            msg = <span style="color:#2b91af;">MailMessage</span>.Load(FullInputFileName, <span style="color:#2b91af;">MessageFormat</span>.Msg);
           
            msgStream = <span style="color:blue;">new</span> <span style="color:#2b91af;">MemoryStream</span>();               
            msg.Save(msgStream,<span style="color:#2b91af;">MailMessageSaveType</span>.MHtmlFromat);
            
            FullconvertedMultiTiffName = <span style="color:#2b91af;">Path</span>.Combine(OutputFolder, <span style="color:#a31515;">"MSGFile.tiff"</span>);
            msgStream.Position = 0;
            <span style="color:green;">// load the MHTML stream using Aspose.Words for .NET</span>
            <span style="color:#2b91af;">LoadOptions</span> opt = <span style="color:blue;">new</span> <span style="color:#2b91af;">LoadOptions</span>();
            opt.LoadFormat = <span style="color:#2b91af;">LoadFormat</span>.Mhtml;
            msgDocument = <span style="color:blue;">new</span> <span style="color:#2b91af;">Document</span>(msgStream);
          
            <span style="color:#2b91af;">ImageSaveOptions</span> options = <span style="color:blue;">new</span> <span style="color:#2b91af;">ImageSaveOptions</span>(Aspose.Words.<span style="color:#2b91af;">SaveFormat</span>.Tiff);
           
            options.ImageColorMode = <span style="color:#2b91af;">ImageColorMode</span>.None;
            options.PageIndex = 0;
            options.Resolution = 200;
            options.PageCount = msgDocument.PageCount;
            options.TiffCompression = <span style="color:#2b91af;">TiffCompression</span>.None;
           
            msgDocument.Save((<span style="color:#2b91af;">Path</span>.Combine(OutputFolder, <span style="color:#a31515;">"MSGFile.tiff"</span>)),options);
           
            <span style="color:blue;">return</span> FullconvertedMultiTiffName;

        }</pre><br><br>Currently showing <br>------------------<br>From :  Nair,Anish<br><br>Expected<br>-----------<br>From : Anish.Nair@xxx.com<br><br>Regards<br>Anish<br>

Hi Anish,


Thank you for writing to us.

Could you please send us your sample message file, as the respective file may be missing the SMTP email address field. We’ll assist you further after looking into it.

I think for all the outlook msg file which i am trying to convert is showing the Display name only for Email Address. Not showing the complete Email Address
Please see the attached sample msg file.

If it is not possible , is there any other way to read all the content and header to a txt file and then convert it back to tif image

Regards
Anish

Hi Kashif Iqbal,

Is there any update on this issue please.
My customer is waiting for my reply.

Regards
Anish

Hi Anish,


Thank you for providing the source file.

After analyzing your file, I found that your file is missing the SMTP address as you can see in the attached screenshot as well. The address is in Exchange format and that is why Aspose.Email is using the available information during conversion to MHTML.

Thanks for your Reply.

But when i click on the email address i am not able to see like your screen shot. But not seeing the complete email address.

Is there any other way to read the complete email address and headers and content of the msg body to doc file and convert this document to tiff image

Regards
Anish

Hi Anish,


Thank you for writing back.

Upon re-investigating this issue, I could observe the issue at my end using hte latest version of Aspose.Email for .NET 2.9.0 and have logged it as NETWORKNET-33791 for further investigation by our development team. As a work around, you could use Aspose.Email only for conversion to TIFF and that retrieves the output as desired. Please have a look at the following code sample for your reference:

Code:

MailMessage msg = MailMessage.Load(dir

  • “FW Rate pages coming thru blank
    URGENT.msg”
    );<o:p></o:p>

MailPrinter printer = new MailPrinter();

printer.FormattingFlags = Aspose.Email.Printing.MessageFormattingFlags.MailInfo;

printer.Print(msg, dir + "test.tiff", PrintFormat.Tiff);