• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 197
  • Last Modified:

Automatic e-mail with attachments

Using Lotus Notes 4.61
I want to create an agent which does the following.

Create and Send an e-mail message to a predefind group of users which adds an attachment to the message.  The attachment will reside on a network drive. I want the agent to create the message , create the attachment from the network drive and e-mail it out

1 Solution
adamcAuthor Commented:
Edited text of question.
Hi Adamc,

Use the code below in agent,  Change the values inside <<<>>> where ever applicable.

Good Luck,



     Dim ss As New notessession
     Dim db As notesdatabase
     Dim doc As notesdocument
     Dim rtitem As notesrichtextitem
     Dim object As NotesEmbeddedObject
     Set db = ss.currentdatabase
     Set doc = db.CreateDocument
     doc.SendTo = "<<<<GroupName>>>>"
     doc.Subject = "<<<<THE SUBJECT OF YOUR MESSAGE>>>>"
     doc.Form = "Memo"
     Set rtitem = New notesRichTextItem (doc,"Body")
     Call rtitem.AppendText( "<<<<<<<<<<<<Any Text message as the content of the mail.>>>>>>>>>>>>>" )
     Set object = rtitem.EmbedObject ( EMBED_ATTACHMENT, "", "<<<<<<<<<c:\jim.sam>>>>>>>>>>>>", "<<<<<<<ANY TEXT -- OPTIONAL>>>>>>>" )
     Call doc.Send(False)


Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now