Set "From address" n Notes email from VBA

Discussion in 'Lotus Notes Administration' started by sebair, Aug 22, 2008.

  1. sebair

    sebair Guest

    I am contracted with an organization that uses Lotus Notes.
    Unforunately, I have zero experience with it. My task is to automate
    the production of some Crystal reports and then email them via Notes.
    That much I have done. Now, I'll try to explain the problem.

    The emails are sent from a workspace mailbox that is not mine (not
    sure is the jargon si correct). I can open it and look at the Sent
    folder. The mail items show up as they should. Here's the issue --
    when I open the Sent folder and look at a message I created in code,
    the From field shows my name. That's Ok. But when another person
    opens the sent folder and looks at the message, it shows their name as
    the From address.

    Oddly, when any recipient opens the message in their own inbox the
    From address is consistently mine.

    Here is the pertinent part of my code.

    Set MailDoc = MailDb.CreateDocument

    With MailDoc

    .Form = "Memo"
    .SendTo = SendTo ' an array of addresses
    .CopyTo = CopyTo ' an array of addresses
    .Principal = "Something other than me"
    .Subject = Subject ' var holding subject line
    .Body = Body ' var holding body text
    .SaveMessageOnSend = True

    .PostedDate = Now() 'Gets the mail to appear in the sent items
    .Send False

    End With

    Does anyone know of a way to set the From address -- or, at least,
    make sure that it always shows the name of the sender no matter who
    opens it?

    sebair, Aug 22, 2008
    1. Advertisements

  2. sebair

    Tim Mohrlant Guest

    I'm guessing that there is no "From" field due to the way the message is
    being mailed from VB. The copy the users get has a "From" field because
    Notes puts it there.

    You could try saving a "From" field after the message has been sent.

    Tim Mohrlant
    Tim Mohrlant, Aug 24, 2008
    1. Advertisements

  3. sebair

    Andy Mic Guest

    For sending email from notes mail UI, there is a 'From' preset at the
    memo form. Since you are using the backend mehtod, you need to update
    the 'From' field as the current username.

    If you check the tmpDisplaySentBy field of the Memo form, you will
    find that the design will try to use current username if there are no
    Form field at the document.

    You may update the code as,
    .From = sess.commonusername ' where sess is the notessession
    you created
    Andy Mic, Aug 27, 2008
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.