Sending emails using Secondary a Lotus Notes User Account

Good Evening, I have written two visual basic modules that sends emails out from another Lotus Notes mail box. One module creates the message, opens up the message in the secondary mailbox and allows the user to send it from the secondary mailbox. When a recipient receives the message it says it came from the secondary mailbox. I then have another module that creates the message in the secondary mail box and sends the message to the recipient. When a recipient receives the message it says it came from the persons’ primary mail box and not the secondary mail box. When I check the secondary mailbox’s sent items I can see the message that was sent to the recipient. When I check the primary mail box’s sent items I do not see the message. I was wondering if any on else has experienced this problem and what solution(s) did you come up with?

Any help or suggestions would be appreciated. As I have tried changing the principal names and I have changed the ‘from’ field and I s till have not got this to work properly.

Below is my code from the second module:

Public Sub gSendHTMLEmailLotus(Recipient As String, _

                            MsgSubject As String, _

                            MsgBody As String)



Dim lotusSession   As New Domino.NotesSession

Dim lotusDocument  As Domino.NotesDocument

Dim lotusDatabase  As Domino.NotesDatabase

Dim lotusbody As Domino.NotesMIMEEntity

Dim lotusheader As Domino.NotesMIMEHeader

Dim lotusstream As Domino.NotesStream

Dim lotusTempdatabase As Domino.NotesDatabase

Dim lotusDirectory As Domino.NotesDbDirectory

Dim InfoMailBoxName As String

Dim InfoMailBoxName2 As String

Dim InfoMailPassword As String

Dim MailServ As String

Dim Server As String

Dim arrayRecipients

InfoMailBoxName = “xyzwInfo.nsf”

InfoMailBoxName2 = “Mail\xwyzInfo.nsf”

InfoMailPassword = “”

On Error GoTo LotusNotesFail

Dim SplitBySemi() As String

SplitBySemi = Split(Recipient, ";")

If UBound(SplitBySemi) > 1 Then

    arrayRecipients = SplitBySemisAndCommas(Recipient)

Else

    arrayRecipients = Recipient

End If

    

Call lotusSession.Initialize(MailPassword)



MailServ = ParseMailPath(lotusSession.GetEnvironmentString("MailServer", True))

Server = lotusSession.GetEnvironmentString("MailServer", True)

Set lotusDatabase = lotusSession.GetDatabase(MailServ, "Mail\" & InfoMailBoxName)

    

Set lotusstream = lotusSession.CreateStream



lotusSession.ConvertMime = False  'Do not conver MIME to rich text



Set lotusDocument = lotusDatabase.CreateDocument()



Call lotusDocument.ReplaceItemValue("Form", "Memo")



Set lotusbody = lotusDocument.CreateMIMEEntity

Set header = lotusbody.CreateHeader("Subject")

Call header.SetHeaderVal(MsgSubject)

Set header = lotusbody.CreateHeader("BCC")

Call header.SetHeaderVal(arrayRecipients)

Call lotusstream.WriteText(MsgBody)

Call lotusbody.SetContentFromText(lotusstream, "text/html;charset=UTF-8", ENC_NONE)



lotusDocument.SaveMessageOnSend = True



lotusDocument.Send False

lotusSession.ConvertMime = True

    

'Clean Up

Set lotusSession = Nothing

Set lotusDocument = Nothing

Set lotusDatabase = Nothing

Set lotusbody = Nothing

Set lotusheader = Nothing

Set lotusstream = Nothing

Set lotusTempdatabase = Nothing

Set lotusDirectory = Nothing

InfoMailBoxName = vbNullString

InfoMailPassword = vbNullString

MailServ = vbNullString

Exit Sub

LotusNotesFail:

MsgBox (“Can not send the mail message, please contact the Development Group.”)

End Sub

Subject: Sending emails using Secondary a Lotus Notes User Account

Look at the $Principal field…

Subject: RE: Sending emails using Secondary a Lotus Notes User Account

Ok. I will take a look at the $Principal name field and change that. I previously looked only the Principal field I believe. I tried so many things I might have forgotten which ones I did.

Subject: RE: Sending emails using Secondary a Lotus Notes User Account

I have tried the following:

Call lotusDocument.ReplaceItemValue(“$Principal”, “CN=xyzinfo/OU=NORW/O=bobslotus”)

Call lotusDocument.ReplaceItemValue(“DisplayFrom”, “xyzInfo”)

Call lotusDocument.ReplaceItemValue(“tmpDisplaySentBy”, “xyzInfo”)

Call lotusDocument.ReplaceItemValue(“DisplayFrom_Preview”, “CN=xyzInfo/OU=NORW/O=bobslotus”)

Call lotusDocument.ReplaceItemValue(“tmpDisplayFrom_Preview”, “CN=xyzInfo/OU=NORW/O=bobslotus”)

Call lotusDocument.ReplaceItemValue(“tmpDisplayFrom_NoLogo”, “CN=xyzInfo/OU=NORW/O=bobslotus”)

Call lotusDocument.AppendItemValue(“From”, “CN=xyzInfo/OU=NORW/O=bobslotus”)

Call lotusDocument.AppendItemValue(“INetFrom”, “xyzInfo@bobslotus.com”)

Call lotusDocument.AppendItemValue(“AltFrom”, “xyzInfo”)

Call lotusDocument.AppendItemValue(“DisplaySent”, “xyzInfo”)

It still has not solved my problem. I have tried appending and replacing values to see if the changes would take place. I was wondering if any one else had any suggestions?