Everything about Domino, PHP and other programming languages

doc.Send versus doc.CopyToDatabase(serverOutbox) method

Ferdi Verlaan  February 22 2010 10:40:23 AM
Normally documents are mailed by 'doc.Send' class and method.
You can also use the doc.CopyToDatabase method. This method is very handy for scheduled or signed mail agents. In this way you always can alter the from and principal field. With the doc.Send method most of the time the current user will be replacing these values. With the mail.box method the principal and from fields remain the same.

This method works when the field note.Recipients is set to value X. Where "note" is the document to send and "X" is the e-mail address(es).

        Dim serverOutbox As NotesDatabase
        Set serverOutbox = New NotesDatabase( db.Server, "mail.box" )

        'Build a document ...

        'Copy this document to the server's outgoing mailbox.
        Call note.Save( True, True, True )
        Call note.CopyToDatabase(serverOutbox)

    Bookmark and Share