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 mail.box 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 mail.box.

Once the document is saved by the code in the mail.box, 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", "mail.box" )  'Use your server name and mail.box 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 = "Corporate.Application@wachovia.com"   'The email address you want the email to be from goes here and line below
docMail.Principal = "Corporate.Application@wachovia.com"
docMail.SendTo = "Steve.Holman@wachovia.com"   'Could use group name if needed here and line below
docMail.Recipients = "Steve.Holman@wachovia.com"
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 mail.box.

This was first published in January 2001

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.