EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Possible values for TElMessageHeader.GetField

Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.
#32438
Posted: 03/03/2015 07:06:06
by Ako Dpeps (Basic support level)
Joined: 02/25/2015
Posts: 13

I have searched the documentation for possible values that you can pass to
TElMessageHeader.GetField().
As I did not found any information about that I just tried GetField("MessageId"). But it return an empty string.
What are the possible values ?
#32439
Posted: 03/03/2015 07:16:55
by Alexander Ionov (EldoS Corp.)

Thank you for contacting us.

Quote
Ako Dpeps wrote:
I have searched the documentation for possible values

Actually message headers can contains fields with almost any name. So there are no "possible values". The method just looks for a field with the given name. If it founds such a field, the found field is returned.

Quote
Ako Dpeps wrote:
I just tried GetField("MessageId"). But it return an empty string.

That's because the correct name is "Message-ID".

If you have an instance of TElMessage class, it's better to use its properties. For example, TElMessage.MessageID property.


--
Best regards,
Alexander Ionov
#32441
Posted: 03/03/2015 07:24:25
by Ako Dpeps (Basic support level)
Joined: 02/25/2015
Posts: 13

This does not work either: It just returns "SBMIME.TElMessageHeaderField":

Code
TElMessageHeader msgHeader;
String charset = "";
client.ReceiveMessageHeader(messageId.Index, ref charset, false, out msgHeader);
String filename = @"C:\temp\" + msgHeader.GetField("Message-ID") + ".eml";



filename: C:\temp\SBMIME.TElMessageHeaderField.eml

I do not have an instance of the TElMessage class, because I want to save the message as file using the message id as filename, so I need to use the ReceiveMessage overload with Stream!
#32442
Posted: 03/03/2015 07:43:09
by Ako Dpeps (Basic support level)
Joined: 02/25/2015
Posts: 13

I have just looked into the TElMessageHeader.HeaderFields property: It actually contains a field named "Message-ID".
This means that the method GetField() does not work (at least in C#).
#32443
Posted: 03/03/2015 08:12:29
by Alexander Ionov (EldoS Corp.)

The GetField method does not return a string, but it returns a TElMessageHeaderField object. You have to check the returned value. If it is null, this means there is no such field in the header. If the returned value is not null, you have to use its Value property to get the field's value as a string.


--
Best regards,
Alexander Ionov
#32444
Posted: 03/03/2015 08:14:30
by Eugene Mayevski (EldoS Corp.)

Also I'd like to remind that the help file is installed on your computer and there's an online version available as well. Checking documentation will save your time as you won't need to wait for our answers.


Sincerely yours
Eugene Mayevski
Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.

Reply

Statistics

Topic viewed 543 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!