'New Notes user email: Option Public Option Declare Use "OpenLogFunctions" Sub Initialize 'Declare Variables Dim s As New NotesSession Dim user As NotesName Dim fname As notesitem Dim inetadd As notesitem Dim nabdb As NotesDatabase Dim viewpeople As NotesView Dim docperson As NotesDocument Dim datetime As New NotesDateTime("01/01/2007") Dim coll As NotesDocumentCollection Dim selection As String Dim firstname As String Dim inetaddress As String On Error Goto gotError Set nabdb = s.GetDatabase("DomServer", "names.nsf") selection = { (MailSystem = "1") & (@Created = @Today) & (@IsUnAvailable($Conflict)) } Set coll = nabdb.Search( selection , datetime , 0) Set docperson = coll.GetFirstDocument While (Not docperson Is Nothing) Set user = New NotesName(docPerson.FullName(0)) Set fname = docPerson.GetFirstItem("FirstName") firstname = fname.Text Set inetadd = docPerson.GetFirstItem("InternetAddress") inetaddress = inetadd.Text Print user.Abbreviated Call Newsletter(user, firstname, inetaddress) Set docperson = coll.GetNextDocument(docPerson) Wend Exit Sub gotError: Call LogError Exit Sub End Sub Sub Newsletter(user As NotesName, firstname As String, inetaddress As String) Dim s As New NotesSession Dim db As NotesDatabase Dim body As NotesMIMEEntity Dim stream As NotesStream Dim host As String Dim view As NotesView Dim doc As NotesDocument Dim sTemp As String On Error Goto gotError Set db = s.CurrentDatabase 'Capture the server name and filepath for use in URLs Dim ServerName As New NotesName( db.Server ) host = "http://" + ServerName.Common & ".domain.com" s.ConvertMIME = False ' Do not convert MIME to rich text Set stream = s.CreateStream Set view = db.GetView("newusertips") Set doc = view.GetFirstDocument() 'Begin creating the message doc to send Dim message As New NotesDocument (db) message.Form="memo" Set body = message.CreateMIMEEntity 'Basic profile of email message.Subject = "Welcome to Lotus Notes" message.SendTo = user.Abbreviated message.RecNoOutOfOffice = "1" 'Set it so out of office agents don't reply to the message message.ExpandPersonalGroups = "0" 'Set message to not expand groups ' Open the HTML (Title doesn't matter since it doesn't appear anywhere) Call stream.WriteText ("Notes Tips Recap") ' BEGIN: Inline Stylesheet Call stream.WriteText (| |) ' END: Inline Stylesheet Call stream.WriteText ({}) Call stream.WriteText ({}) ' BEGIN: HTML body Call stream.WriteText ({


} + Cstr(firstname) + {,

Welcome to Lotus Notes, YourCo's e-mail, calendaring, and collaboration platform. Below you will find a sampling of tips for Lotus Notes and/or Domino Web Access. Click each link to open and read the tip.

You will want to review the tip on changing your password, if you haven't already been walked through the password change process. Next, you'll want to create your signature block for your email. Feel free to look through all the tips as you have time, or use the built-in help feature in Notes by hitting the F1 key for help related to the task you're performing. As new tips are added, you'll get email notification, along with a monthly recap of all tips that are available.


For outside contacts, your email address is: } + Cstr(Inetaddress) + {

A sample of Notes Tips you may find helpful now:

    }) Do Until doc Is Nothing 'You will have to hardcode the server_name and databasePath in a scheduled agent because there is no 'fixed method for getting these variables. They could come from the server document, but everyone has a different set up. sTemp=sTemp+|
  • }+Cstr(doc.Subject(0))+{ - Published: } + Cstr(doc.Created) + {
  • }) Set doc=view.getnextdocument(doc) Loop Call stream.WriteText({

Here's a link to the Notes Signature Wizard to create or update your mail signature: }) Call stream.WriteText ({
Visit the Notes Tips database for more tips. If you are using a browser, please go to http://dwaserver.domain.com/tips/notestips.nsf to view the tips.
If you need assistance with Notes, please call the Helpdesk at 888-555-1234.
}) ' END: HTML body ' Close the HTML Call stream.WriteText ({}) ' Ensure the MIME content will be recognized as HTML (Must be after the stream is written) Call body.SetContentFromText (stream, "text/html;charset=iso-8859-1", ENC_NONE) 'Send the email Call message.Send (False) s.ConvertMIME = True ' Restore conversion Exit Sub gotError: Call LogError Exit Sub End Sub