Closed SigiKoh closed 10 months ago
I'll try to look into it tomorrow. I'm not home at the moment
What exactly do you want to do?
hi,
i need to add the property „billinginformation“, but could not manage it with your hint…
using (var email = new Email( new Sender(SenderTextBox.Text, string.Empty), SubjectTextBox.Text, DraftMessageCheckBox.Checked, ReadReceiptCheckBox.Checked)) { email.Recipients.AddTo(ToTextBox.Text); email.Subject = SubjectTextBox.Text; email.BodyText = TextBodyTextBox.Text; email.Attachments.Add("Images\peterpan.jpg");
email.AddProperty(„BillingInformation“, "1234abcd");
email.Save("c:\\temp\\email.msg");
}
System.Diagnostics.Process.Start("c:\\temp\\email.msg");
so that my addin can work with this information, when this mail ist sent.
I added the billing property. Please download the latest version from nuget.
You then can use it like this
wow – you made my day! 😊 thank you very much!!
unfortunately it does not work properly yet: After I added the property and saved the msg file, MFCMAPI shows an error.
When I display this msg-file in outlook, the property disappears:
I guess it expects some kind of format in that property. Do you have an e-mail that has this property set so that I can look how this property is build up? When looking to the PidLidBilling property (https://learn.microsoft.com/en-us/office/client-developer/outlook/mapi/pidlidbilling-canonical-property) it expects an unicode string... but I have no idea what needs to be in this string.
hi, do you think, there is any chance of a solution to my problem? thank you!
I'll try to look into it again. It was a very busy week last week so I did not do much on my opensource projects.
I looked into your example e-mail and I think Outlook is probably expecting some other parameters to. But without any good documentation about how this works it is hard to figure out.
This is all I can find online about that property
hi,
for me, whole MAPI is quite complicated.
i asked this question in a forum an got an answer with „NamedProperty“, but this didnt help me …
?
I just released a new nuget package. This one should work when trying to add a named property. I totally missed it that this was a named property not a normal one so the code I gave you never worked.... sorry about that... I just only now had the time to look into it a little bit deeper.
Great!! Thank you! :-)
Just to notice, it is normal that the property gets another value. This is how named properties work.
Just let me know it this fixes your issue so that I can close this issue.
i just tested – works! thumbs up…
https://github.com/Sicos1977/MsgKit/issues/78 i am still struggling with the same problem ☹only one hint is too little for a beginner. is it possible, that you tell me the code I need? or any chance of getting a version of MsgKit, which is able to set the „Billing“-Property? i would pay for it?