Q
Problem solve Get help with specific problems with your technologies, process and projects.

Customize the principal field of outgoing email messages

Learn about different options using LotusScript code and Formula language to customize the principal field of outgoing Lotus Notes email messages.

Dear Cregg: I am sending email messages from a Domino Web application, which features an @Mailsend command behind a button. The email messages are being sent properly, except when an anonymous user sends a message using this application. In such a case, the sender appears as: servername/dominodomain@internetdomain.com. How can I customize this and set the sender field?

To accomplish what you want, you have to set the principal field of the outgoing email messages. This is easier to do in LotusScript than Formula language. In LotusScript, to send a minimal email, you could use something like this:

 
Dim Session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase

Dim email As NotesDocument
Set email = db.CreateDocument
email.form="Memo"
email.principal="My Favorite User"
email.subject="subject"
email.body = "body"
Call email.Send(False,"Addressee or 
array of addressees")

In Formula language, it's a little trickier. You cannot set field contents directly. Instead, you pass them to @Mailsend as arguments. If @Mailsend does not have the argument you need, then you have to have the value set in the Lotus Notes document before you send it, and then use the @Mailsend parameter that causes certain fields to be included. Depending on your application, this may or may not be practical.

If your Domino Web application is creating a document, and that document is the one that contains the button and that is being sent out, then simply add a computed field called principal to the form. Give this field a formula to set its value to the readable value you would like. Be sure to note that in Lotus Notes, this value does not have to correspond to a real, addressable user. But if it doesn't, make sure you also add a "Replyto" field which does.

Now to your @mailsend command, add the "bodyfields" argument to tell it to include the principal and "Replyto" fields calculated when the document is created:

@MailSend( "sendTo" ; "" ; "" ; "subject" ; 
"remark" ; "principal":"replyto" )

Do you have comments on this Ask the Expert Q&A? Let us know.

Related information from SearchDomino.com:

This was last published in November 2008

Dig Deeper on LotusScript

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Join the conversation

1 comment

Send me notifications when other members comment.

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

Please create a username to comment.

The @mailsend information is incorrect. Adding body fields will only put the text values of those fields into the body of the document being mailed. It will not add fields to the email header or document. You can not control the return address of an @mailsend memo this way. To use @mailsend and have "ReplyTo" or "Prinicpal" fields, you must use @mailsend without parameters and include those fields on the document being mailed.
Cancel

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com'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 ...

SearchDataCenter

SearchExchange

SearchContentManagement

Close