Can you change the From part of an email?
Posted on 2005-04-14
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 NewMail As NotesDocument
Dim session As NotesSession
Dim db As NotesDatabase
Set session = CreateObject("Lotus.notessession")
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)
Set rtitem = NewMail.GetFirstItem("Body")
'Send the message
NewMail.Send (False), (Person)