Tip

Getting mail.box database

View member feedback to this tip.

When sending mails using LotusScript, most of us create the document directly in the mail.box database. In doing so, we usually look for the database "mail.box." There is a great threat with using mail.box, if we change the server configuration to use more than one mail.box, in which case the server will create mail1.box, mail2.box, etc. So it's always safer to check for a database mail1.box in your script, and if it doesn't find one, then open mail.box.

Function GetMailDb () As
 NotesDatabase
 Dim Sess As New NotesSession
 Dim Db As notesdatabase
 
 Set Db = Sess.Currentdatabase
 
 Set GetMailDb = New notesdatabase 
( Db.Server, "Mail1.Box" )
 
 If Not GetMailDb.IsOpen Then
  
  Set GetMailDb = New notesdatabase 
( Db.Server, "Mail.Box" )
  
 End If
 
 If Not GetMailDb.IsOpen Then
  
  Set GetMailDb = Nothing
  Print "Unable to Mail Box.
 Could not send email."
  
 End If
 
End Function

MEMBER FEEDBACK TO THIS TIP

This tip states: "Most of us create the document directly in the mail.box database."

I have never heard of anyone creating a document in mail.box. Why would you need to? See the Send method in the help database. All you need to do is create a document in the current database and '.send.' It will not be saved in the database, just e-mailed.

-- Tony B.

Do you have comments on this tip? Let us know.


This was first published in March 2004

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
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
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.