Author |
|
Luca Guest Group
Joined: 10 November 2003
Online Status: Online Posts: 262
|
Posted: 29 June 2005 at 10:14am | IP Logged
|
|
|
Should I create an HTML message with empty AltBodyText, when sending it AltBodyText is generated by MailBee using GetPlainFromHtml method (as it is stated in docs).
Is there a way to avoid this, in case I just want to send an HTML message with no plain text at all?
|
Back to Top |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 29 June 2005 at 11:09am | IP Logged
|
|
|
MailBee automatically generates plain-text version only when receiving mail. When composing mail, it's REQUIRED to call Message.MakeAltBody in order to create plain-text version.
So, you need to do nothing in order to create HTML-only messages.
Regards,
Alex
|
Back to Top |
|
|
Luca Guest Group
Joined: 10 November 2003
Online Status: Online Posts: 262
|
Posted: 29 June 2005 at 11:45am | IP Logged
|
|
|
Sorry it was my mistake: this behaviour only happens when importing an .eml file. My app sends a message, then saves it and finally reloads it. In this case (after reloading) AltBodyText is automatically generated:
Dim oMailer As New MailBee.SMTP
oMailer.Message.BodyFormat = 1
oMailer.Message.BodyText = "<p>test</p>"
MsgBox oMailer.Message.AltBodyText
oMailer.Message.SaveMessage "C:\test.eml"
oMailer.Message.ImportFromFile "C:\test.eml"
MsgBox oMailer.Message.AltBodyText
The problem is fixed using ".AltBodyOptions" property (from yor previous message):
Dim oMailer As New MailBee.SMTP
oMailer.Message.BodyFormat = 1
oMailer.Message.BodyText = "<p>test</p>"
MsgBox oMailer.Message.AltBodyText
oMailer.Message.SaveMessage "C:\test.eml"
oMailer.Message.AltBodyOptions = 0
oMailer.Message.ImportFromFile "C:\test.eml"
MsgBox oMailer.Message.AltBodyText
|
Back to Top |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 29 June 2005 at 12:17pm | IP Logged
|
|
|
BTW, if you need to just resend messages preserving original message body (i.e. everything you want is to add/modify some headers and resend the message) you can use undocumented MinimalRebuild property and AddHeader/RemoveHeader methods:
Code:
oMailer.Message.MinimalRebuild = True
oMailer.Message.ImportFromFile "C:\test.eml"
oMailer.Message.AddHeader "To", "someone@domain.com"
MsgBox oMailer.Message.AltBodyText
oMailer.Send
|
|
|
Note that AddHeader will overwrite existing header if it already exists.
In minimal rebuild mode, MailBee does not touch message body itself, and headers manipulation is limited to AddHeader/RemoveHeader methods. Setting and calling other message manipulation methods and properties does not have any effect. MailBee will not add its own headers, etc. For example, "Received:" timestamp headers will be preserved if you didn't delete them with RemoveHeader method.
Thus, minimal rebuild mode allows you to keep original encodings, MIME boundaries, headers formatting, etc.
Regards,
Alex
|
Back to Top |
|
|
Luca Guest Group
Joined: 10 November 2003
Online Status: Online Posts: 262
|
Posted: 29 June 2005 at 12:35pm | IP Logged
|
|
|
Thanks, that was very useful (and very fast support too: I'm very glad I made the right choice buying your components some days ago).
Will undocumented properties (or methods) be preserved in future releases?
|
Back to Top |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 29 June 2005 at 1:04pm | IP Logged
|
|
|
Yes, all undocumented properties and methods will be preserved.
Also, some of these properties/methods will be officially released/documented in future versions.
Regards,
Alex
|
Back to Top |
|
|