Tip

Control Of The From Field In Mails Sent From Agents

In many databases there is one or more agents that's sends mail.
On all mails, the Notes mailer set's the 'from' field to the programmers name
(the person that have made or last saved the agent).

The programmer will receive a lot of replys on these mails.

You cant change the From field on mailed documents - this is done automatically
by the server or the clients mailer program.

But you can change the From field on Saved documents - so the solutions is
simpel:
1. Create the mail as a new document in the servers mail.box
2. Assign values to these fields:
Form = Memo
SendTo = Name, group, shortname for receipients
Receipients = Fullnames for all receipients for the mail
From = Who is the mail from? The user will reply to this address
3. Save the document

Now the servers mailer task will process the document as a normal mail.


'Sent a mail to Peter from Santa
dim session as new NotesSession
dim thisDb as NotesDatabase
dim mailboxDb as NotesDatabase
dim mailDoc as NotesDocument

'Locate the servers mail.box database
set thisDb = session.CurrentDatabase
set mailboxDb = session.GetDatabase( thisDb.server, "mail.box" )

'Create the new mail
set mailDoc = mailboxDb.CreateDocument

'Assign values to the fields in the mail
mailDoc.Form = "Memo"
mailDoc.SendTo = "Peter"
mailDoc.Receipients = "Peter/TheCompany"
mailDoc.From = "Santa"
mailDoc.Subject = "Mail from Santa"
mailDoc.Body = "The text goes here"

'Save the document in the mail.box (if you Send the document, Notes will
overwrite the From field)
call mailDoc.Save( True, True )


This was first published in November 2000

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.