Manage Learn to apply best practices and optimize your operations.

Let Applications Send Mail Addressed From Themselves

Here is the code you need to let one of your applications send a mail and address it from itself, instead of from the server or from the persons name that saved the agent. Basically, what you are going to do with the code is bypass the Notes "Send" functionality. Instead of letting the application send the email, you are going make code the will actually create the memo in the of the server and trick the server into sending the mail for you with a from address of whomever you want. Here is the raw LotusScript code to create an email in the

Once the document is saved by the code in the, the Notes router takes over and routes the mail. There is no address checking or anything, it just routes the document it was given to the appropriate address. The users on the other end will not be able to tell where the email came from, unless they are very savvy Notes users. If the email is sent via the Internet there is no way possible to tell where the email came from except for the address you put in there. Oh yeah, make sure the address you use is valid, because people may try to reply to it even though you tell them not to.

Dim session As New NotesSession
Dim router As NotesDatabase
Dim docMail As NotesDocument			

Set router = New NotesDatabase( "GAG01/G/WACH", "" )  'Use your server name and name if different			
Set docMail = New NotesDocument( router )  'Starts the creation of th new email
docMail.Form = "Memo"  'Set the new email form to memo so it will have the proper fields
docMail.Subject = "Your Subject"  'Any text you want for the subject
docMail.Body = "Your Body Text"   'Any text you want for the body
docMail.From = ""   'The email address you want the email to be from goes here and line below
docMail.Principal = ""
docMail.SendTo = ""   'Could use group name if needed here and line below
docMail.Recipients = ""
docMail.PostedDate = Now()  'Uses the current date and time
docMail.DeliveredDate = Now()
docMail.ComposedDate = Now()
docMail.EncryptOnSend = False
Call docMail.Save( True, True )  'Saves the document in the

Dig Deeper on Domino Resources - Part 7

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...