Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9113301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:56:04+00:00 2026-06-17T03:56:04+00:00

I’m writing a program where I can send mails (using domino.dll) from three different

  • 0

I’m writing a program where I can send mails (using domino.dll) from three different department mailboxes (each using its own mail server and nsf-file).
All three department mailboxes have a predefined mail signature such as

Regards
Department X

Since those can change anytime I don’t want to hardcode the signature in my program but extract them from the mailbox/nsf-file instead and append it to the mail body (or something else if there are better approaches).

I’ve been looking around all day without finding a solution to this problem, so my question is: How is this achieved?

So far my code is similar to this:

public Boolean sendNotesMail(String messageText)
    {
        //Create new notes session 
        NotesSession _notesSession = new NotesSession();
        //Initialize Notes Database to null; 
        NotesDatabase _notesDataBase = null;
        //Initialize Notes Document to null; 
        NotesDocument _notesDocument = null;

        string mailServer = @"Path/DDB";
        string mailFile = @"Deparmentmail\number.nsf";

        //required for send, since its byRef and not byVal, gets set later. 
        object oItemValue = null;

        // Start the connection to Notes. Otherwise log the error and return false
        try
        {
            //Initialize Notes Session 
            _notesSession.Initialize("");
        }
        catch
        {
           //Log
        }

        // Set database from the mailServer and mailFile
        _notesDataBase = _notesSession.GetDatabase(mailServer, mailFile, false);

        //If the database is not already open then open it. 
        if (!_notesDataBase.IsOpen)
        {
            _notesDataBase.Open();
        }

        //Create the notes document 
        _notesDocument = _notesDataBase.CreateDocument();

        //Set document type 
        _notesDocument.ReplaceItemValue("Form", "Memo");

        //sent notes memo fields (To and Subject) 
        _notesDocument.ReplaceItemValue("SendTo", emailAddress);
        _notesDocument.ReplaceItemValue("Subject", subjectText);
        // Needed in order to send from a departmental mailbox
        _notesDocument.ReplaceItemValue("Principal", _notesDataBase.Title);

        //Set the body of the email. This allows you to use the appendtext 
        NotesRichTextItem _richTextItem = _notesDocument.CreateRichTextItem("Body");

        // Insert the text to the body 
        _richTextItem.AppendText(messageText);
        try
        {
            _notesDocument.Send(false, ref oItemValue);
        }

}

EDIT:
Thanks to Richard Schwartz my solution is:

object signature = _notesDataBase.GetProfileDocument("calendarprofile", "").GetItemValue("Signature");
String[] stringArray = ((IEnumerable)signature).Cast<object>().Select(x => x.ToString()).ToArray();
_richTextItem.AppendText(stringArray[0]);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T03:56:05+00:00Added an answer on June 17, 2026 at 3:56 am

    The signature is stored in a profile document in the NSF file. You can use the method NotesDatabase.getProfileDocument() to access it. This method takes two arguments:

    ProfileName: The profile document name that you need to find the signature is “calendarprofile”. (Yes, that’s right. It’s actually a common profile for many functions, but the calendar developers got there first and named it. ;-))

    UniqueKey: Leave this as an empty string. (It is traditionally used to store a username in profile documents in shared databases, but not used in the calendarprofile doc in the mail file.)

    You access data in the profile document the same way that you access them in regular documents, e.g., using getItem(), getItemValue(), etc. For a simple text signature, the NotesItem that you are looking for is called “Signature”. I notice, however, that there are also items called “Signature_1” and “Signature_2”, and “SignatureOption”.

    If you look at the Preferences UI for setting signatures in Notes mail, you will see that there is a choice between simple text and HTML or graphic files. No doubt this choice will be reflected in the SignatureOption item, so you will probably want to check that first. I have not explored where the data goes if you use imported HTML or graphic files, so I can’t say for sure whether it goes into Signature, Signature_1, Signature_2, or somewhere else. But you can explore that on your own by using NotesPeek. You can download it here. It presents a tree-style view of the NSF file. There’s a branch of the tree for Profiles, and you can find the calendarprofile there. Then just play around with different settings in the Notes mail preferences and see what changes. (NotesPeek doesn’t pick up changes on the fly. You have to close and re-open the profile in NotesPeek after saving changes in the Notes mail preferences dialog in order to see the changes.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know how can I replace this 2 symbol below from the string
I am using jsonparser to parse data and images obtained from json response. When
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am using JSon response to parse title,date content and thumbnail images and place
For some reason, after submitting a string like this Jack’s Spindle from a text
I am using the SimpleRSS gem to parse a WordPress RSS feed. The only
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.