Question

I want to verify email body content in .eml files saved to disk. I have added the following section to my App.config file:

<system.net>
    <mailSettings>
        <smtp deliveryMethod="SpecifiedPickupDirectory">
            <specifiedPickupDirectory pickupDirectoryLocation="d:\temp\emails\"/>
        </smtp>
    </mailSettings>
</system.net>

Sometimes some of the body content in the .eml file is saved incorrectly. I have some values that are being saved with double decimal points

Example:

ABC, XYZ, 2.00, 0..19609, 0.2117772

When I take out the config section and the email is sent to my outlook inbox, I do not get this issue. Example:

ABC, XYZ, 2.00, 0.19609, 0.2117772

It is always the same values that are correct and incorrect. I wouldn't expect that the saving of a file would modify content. Any help on what might be happening here would be much appreciated.

Was it helpful?

Solution

As I understand it, this is to be expected as the file produced is not supposed to be a straight copy but rather follow the rfc822 spec (see http://www.w3.org/Protocols/rfc822/3_Lexical.html).

If you want to compare the file output with your input, then I think you will need to find/write a routine to decode the rfc822 back to plain test.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top