Can you change the From part of an email?

Posted on 2005-04-14
Last Modified: 2013-12-18
I've got a database which pulls in information from email inbox and then replies to it. My reply email works fine but what I want to do is to be able to change the From part of the email so that it doesnt appear to be from the email address but from a different one.

My code is shown below (function createmail) and this is the line I want to add in but I don't know the actual name of the notesitem for From - I've tried using From but that doesnt change the From address.

szTempString = NewMail.AppendItemValue("From", "UK Fleet and Facilities")

What I'd like to know is, is it possible to change the From address to show something else and if so how?

Thanks for any help

Function CreateMail(subj, msg, Person)
Dim rtitem As Variant
Dim szTempString
Dim NewMail As NotesDocument
Dim session As NotesSession
Dim db As NotesDatabase

Set session = CreateObject("Lotus.notessession")
Call session.Initialize("password")
Set db = session.GetDatabase("mailserver", "mailfile.nsf", False)

Set NewMail = db.CreateDocument

szTempString = NewMail.AppendItemValue("Form", "Memo")
szTempString = NewMail.AppendItemValue("Subject", subj)
szTempString = NewMail.AppendItemValue("SendTo", Person)

NewMail.CreateRichTextItem ("Body")
Set rtitem = NewMail.GetFirstItem("Body")
rtitem.AppendText (msg)
'Send the message
NewMail.Send (False), (Person)
end function
Question by:ProfJames
    LVL 46

    Accepted Solution

    If it's Notes mail, then it's the signer of the agent who sends the mail. You can only try to use the person's id to send the mail.

    If it's Internet mail, you could set the field Principal to the intended sender's name. In some cases, you also need to set the field INetFrom to the same name.
    LVL 14

    Expert Comment

    Just say
    NewMail.Principal = "<whatever name you want>"
    Newmail.replyto = "<whatever name you want the user to reply to>"


    Author Comment

    fantastic!! I tried Prinicipal and it worked!! thanks very much, dont know why it didnt occur to me to use principal in the first place cos thats what I use to extract the senders name when the db first receives the email!

    anyway thanks again.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
    Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now