Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Classic ASP) Generate a Unique Key for an EmailDemonstrates how to generate a unique key for an email.
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> <% set email = Server.CreateObject("Chilkat_9_5_0.Email") success = email.LoadEml("qa_data/eml/someEmail.eml") If (success <> 1) Then Response.Write "<pre>" & Server.HTMLEncode( email.LastErrorText) & "</pre>" Response.End End If ' The ComputeGlobalKey method computes a global unique key for an email that may be used as a ' key for a relational database table (or anything else). ' The key is created by a digest-MD5 hash of the concatenation of the following header fields: ' Message-ID, Subject, From, Date, To. (The header fields are Q/B decoded if necessary, ' converted to the utf-8 encoding, concatenated, and hashed using MD5.) ' The 16-byte MD5 hash is returned as an encoded string (such as base64, url, hex, etc.) ' If the bFold argument is true, then the 16-byte MD5 hash is folded to 8 bytes with an XOR to produce a shorter key. bFold = 0 key = email.ComputeGlobalKey("hex",bFold) Response.Write "<pre>" & Server.HTMLEncode( "key: " & key) & "</pre>" %> </body> </html> |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.