Home > Ask the Domino Experts > LotusScript Questions & Answers > Customize the principal field of outgoing email messages
Ask The Domino Expert: Questions & Answers
EMAIL THIS

Customize the principal field of outgoing email messages

Cregg Hardwick EXPERT RESPONSE FROM: Cregg Hardwick

Pose a Question
Other Domino Categories
Meet all Domino Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 20 November 2008
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:

  • Tip: Using Formula language code to sort Notes messages by subject
  • Tip: Show unread marked Lotus Notes email messages using LotusScript
  • Expert Response: Track incoming and outgoing email messages


  • Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



    RELATED CONTENT
    LotusScript
    Can you use LotusScript to read a text file attached to a Notes doc?
    Can I use LotusScript to merge cells in a Microsoft Word table?
    Modifying LotusScript code for date and time handling
    Use DXL utilities for advanced replication settings in Notes
    Use LotusScript to create encrypted replicas
    Write a LotusScript agent to automate file attachments
    Troubleshooting a scheduled agent not running on a Global Notes Architecture (GNA) server
    Setting up local replication of a Lotus Notes database for offline employees
    Creating a link on an HTML page to a Microsoft Word attachment in a Lotus Notes database
    LotusScript to extract and move attachments to a Lotus Notes mailbox or file folder

    LotusScript
    LotusScript agent parses ACL to Microsoft Notepad
    LotusScript finds the first occurrence of a string from the right
    Clear Recent Contacts view and prevent repopulation in Lotus Notes 8.x
    Search Microsoft Active Directory with LotusScript
    Three steps to trap and handle save conflicts with LotusScript
    Troubleshoot agents by displaying LotusScript variables online
    LotusScript sorts lists alphabetically
    Run or restart Notes/Domino agents via text messages
    LotusScript code rebuilds corrupted busytime.nsf file
    Soft-code item names to facilitate LotusScript management

    Lotus Notes Domino Mailbox Management
    Secure Lotus Notes/Domino 8.x from mail to unknown recipients
    Run or restart Notes/Domino agents via text messages
    How to create mail files using a LotusScript agent
    How to turn off the message recall feature in Lotus Notes 8
    Domino server setting and email policy tricks admins must know
    LotusScript action button manages Lotus Notes mail files
    JavaScript error encountered when opening Lotus Notes email
    Bringing MailRule documents back into view
    LotusScript agent moves tagged spam email to junk mail folder
    Limit the size of incoming email attachments to a Lotus Domino server

    RELATED RESOURCES
    2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
    Search Bitpipe.com for the latest white papers and business webcasts
    Whatis.com, the online computer dictionary



    Search and Browse the Expert Answer Center
    Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
    Browse our Expert Advice



    Lotus Notes Domino on Blackberry and mobile devices
    HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
    About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
    SEARCH 
    TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

    TechTarget Corporate Web Site  |  Media Kits  |  Site Map




    All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
      TechTarget - The IT Media ROI Experts