K
Kukulkan
Hello,
I like to manipulate a mail before sending. But after modifying
(subject, message, attachments), the e-mail gets allways sent using
the default account and not using the selected account (VB6 COM AddIn
using Redemption Objects):
To trace the problem I made a little routine to find out which sender
currently is selected for a given Mailobject:
Public Function GetMailSenderAccountName(ByRef Mailobject As Object)
Dim RDOSession As Redemption.RDOSession
Dim RDOMessage As Redemption.RDOMail
Mailobject.Save ' needed to get an EntryID
Set RDOSession = CreateObject("Redemption.RDOSession")
RDOSession.MAPIOBJECT = Application.Session.MAPIOBJECT
Set RDOMessage = RDOSession.GetMessageFromID(Mailobject.EntryID)
GetMailSenderAccountName = RDOMessage.Account.Name
End Function
Using the following code, I get allways the correct account:
Set MyItem = ConnectClass.VBInstance.Session.GetItemFromID(ItemID)
Debug.Print "Before sending: " & GetMailSenderAccountName(MyItem) ->
"smtp.correct.com"
RedemptionMail.Item = MyItem ' use redemption objects here (needed?)
RedemptionMail.Send
Debug.Print "After sending: " & GetMailSenderAccountName(MyItem) ->
"smtp.correct.com"
But the mail has been sent using the wrong account (default account).
The "smtp.correct.com" account is working great, if I do not use the
methods above. Same problem using OL2003 and OL2007.
What can I do to keep the selected account for sending?
Thank you,
Kukulkan
I like to manipulate a mail before sending. But after modifying
(subject, message, attachments), the e-mail gets allways sent using
the default account and not using the selected account (VB6 COM AddIn
using Redemption Objects):
To trace the problem I made a little routine to find out which sender
currently is selected for a given Mailobject:
Public Function GetMailSenderAccountName(ByRef Mailobject As Object)
Dim RDOSession As Redemption.RDOSession
Dim RDOMessage As Redemption.RDOMail
Mailobject.Save ' needed to get an EntryID
Set RDOSession = CreateObject("Redemption.RDOSession")
RDOSession.MAPIOBJECT = Application.Session.MAPIOBJECT
Set RDOMessage = RDOSession.GetMessageFromID(Mailobject.EntryID)
GetMailSenderAccountName = RDOMessage.Account.Name
End Function
Using the following code, I get allways the correct account:
Set MyItem = ConnectClass.VBInstance.Session.GetItemFromID(ItemID)
Debug.Print "Before sending: " & GetMailSenderAccountName(MyItem) ->
"smtp.correct.com"
RedemptionMail.Item = MyItem ' use redemption objects here (needed?)
RedemptionMail.Send
Debug.Print "After sending: " & GetMailSenderAccountName(MyItem) ->
"smtp.correct.com"
But the mail has been sent using the wrong account (default account).
The "smtp.correct.com" account is working great, if I do not use the
methods above. Same problem using OL2003 and OL2007.
What can I do to keep the selected account for sending?
Thank you,
Kukulkan