Click here to Skip to main content
15,915,791 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I want to send email with any type of hidden data with that mail.

Is this possible?

Regards,
Manikandan Muthuraj
Posted
Updated 27-May-10 4:14am
v2

What do you mean by "hidden data"? Do you mean a hiden file attachment, or hidden data in the email text? Either way, I have to ask why you want to do this because to be honest, your request doesn't pass the smell test.
 
Share this answer
 
Comments
manikandan711 27-May-10 8:31am    
Hi John,
Thank u for quick response.
I want to make the mail unique for some transactions, so i need to place unique id with tat mail
#realJSOP 27-May-10 10:25am    
Just create a guid and include it at the bottom of the message. It doesn't matter if the recipient sees it, and it doesn't mean anything to anyone but the sender. What's the harm in putting it in the email in plain sight?
Manikandan,

I can think of a number of options. First off, if you are dealing with something secure, I would try encryption.

Conversely, you could try hiding in plain sight by attaching the hidden text in an image. Do a google search on "hide text in an image" if you want more information on this.

But if you are hiding something simple like a password link inside an email, you could try hiding it in plain sight in the link. This isn't really encryption, it's obfuscation.

Something like this would take a 20 character string and drop your string in the 34th place. Then, when I call UnObviscateWebUserIdFromQueryString, I go and I grab what I need. It works if all of your strings are of constant length and you are grabbing it the same way every time from the same junk string.

This isn't going to work for a banking application, but if you are using it for something simple like password reset or or passing information that might be confusing to a user and thus they shouldn't be bothered with seeing it, it will work.

Good luck,

Ryan McBeth

        public static string GenerateObviscation(int iLength)
        {

            RandomStringGenerator R = new RandomStringGenerator();
            return R.NextString(iLength, true, true, true, false);


        }
     
public static string ObviscateSingleQueryString(string ToObviscate)
        {
            string sFakeQueryName = GenerateObviscation(40);
            sFakeQueryName = sFakeQueryName.Insert(20, "=");
            sFakeQueryName = sFakeQueryName.Insert(24 + 1 + 8, ToObviscate);
            return sFakeQueryName;
        }

        public static string UnObviscateWebUserIdFromQueryString(string ToObviscate)
        {
            string sToReturn = ToObviscate.Substring(sQueryString.Length - 18, 10);

            return sToReturn;
        }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900