Hello
When saving items from large Pst storages, shall we call GC.Collect() per hundred of messages processed?
Thanks
Hello and thanks, if you don’t mind may I also ask the difference between these 3 and the preferred one to be scheduled for the next week?
Note that I will set both Rtf and Html parts, so first I use:
MSG.SetBodyContent(MyHTM, BodyContentType.Html, False)
Then will proceed to:
MSG.SetBodyContent(Encoding.ASCII.GetString(MyRTF.ToArray), BodyContentType.Rtf, False)
vs
MSG.SetBodyRtf(Encoding.ASCII.GetString(MyRTF.ToArray), False)
vs
MSG.BodyRtf = Encoding.ASCII.GetString(MyRTF.ToArray)
If you use this method, the BodyContentType of the message will be Html
In the remaining 3 cases, the BodyContentType of the message will be Rtf.
All 3 cases are equal because inside the dll is using MSG.SetBodyRtf(Encoding.ASCII.GetString(MyRTF.ToArray), False).
for all of these methods.
Hello,
Thanks, the only thing not clear, if I set both:
MSG.SetBodyContent(MyHTM, BodyContentType.Html, False)
and
MSG.SetBodyRtf(Encoding.ASCII.GetString(MyRTF.ToArray), False)
What happens?
Also, the new 23.6 build showed up an error:
Dim MyCardContact As Email.PersonalInfo.Contact = Email.PersonalInfo.Contact.Load(source, Email.PersonalInfo.ContactLoadFormat.WebDav)
Warning: Aspose.Email.PersonalInfo.Contact is obsolete: This class is deprecated and will be removed soon, use the VCardContact and MapiContact classes to work with contacts.
OK but how do they support loading of ContactLoadFormat.WebDav?
I mean VCardContact or MapiContact support loading CardDav WebDav like PersonalInfo.Contact?
When saving contacts from PST, cannot save Msg directly as Eml, you already provided:
Dim vcard As VCardContact = VCardContact.Load(fileName)
Dim eml As MailMessage = New MailMessage() With {.Subject = vcard.IdentificationInfo.DisplayName}
Dim ms As MemoryStream = New MemoryStream()
vcard.Save(ms)
eml.AlternateViews.Add(New AlternateView(ms, New ContentType(“text/vcard”)))
This works, but what about Calendar Items/ Events/ Exceptions?
Can be saved directly from Msg to Eml or also will need a similar way to go?
The last value will be set as message’s body.
We will provide possibility to load WebDav into VCardContact or MapiContact before removing Contact
We provided method Appointment.ToMailmessage() , hope this help.
Also we plan add VCardContact.ToMailmessage() in future.
Sure, very helpful.
Hopefully it will internally implement?
eml.AlternateViews.Add(New AlternateView(ms, New ContentType(“text/vcard”)))
Anyway, when saving ics as eml, the ics itself is attached as meeting.ics
To have the same behavior with contact, I mean saving vcf as eml, attach the vcf to eml named contact.vcf what’s the best approach? And possible to have it in the future VCardContact.ToMailmessage() method?
Thanks
Yes, it will be implemented exactly this way.
Thanks, when saving vcf contact as msg and/or eml how to force the save module to attach the vcf file itself to the target email message?
Currently not embedded support, but can you please share a sample to add such attachment when saving as Msg and Eml ?
Hello @australian.dev.nerds,
Please try the following code:
Dim vcard As VCardContact = VCardContact.Load("my.vcf")
Using ms As MemoryStream = New MemoryStream()
vcard.Save(ms, ContactSaveFormat.Msg)
Dim eml As MailMessage = MailMessage.Load(ms)
eml.Save("my.eml")
End Using
When saving MailMessage in eml, the vcf content will be attached as text/vcard AlternateVIew.
I hope it helps you. Thanks.
Thanks, to set the MapiMessage plain text part:
MapiMessage.Body
vs
MapiMessage.SetBodyContent(bodyString, BodyContentType.PlainText, False)
Any difference? Or which one is called internally for both?
SetBodyContent (body, type, COMPRESSION) The last parameter: Compression - will have effect on Rtf part only? or all parts?
Thanks
MapiMessage.Body
sets the text body only.
MapiMessage.SetBodyContent
sets all properties (PidTagRtfCompressed, PidTagBody, PidTagRtfInSync) that relate to the message content. The Compression parameter applies only to a property that contains RTF.