Solved

Can you schedule mail to be sent ahead of time?

Posted on 2000-04-28
3
175 Views
Last Modified: 2013-12-18
I need to now if and how to set up certain emails to go when I am not here? Is there a way to schedule this??
0
Comment
Question by:skatpmq
  • 2
3 Comments
 
LVL 5

Expert Comment

by:snocross
ID: 2760733
You can create a separate db and copy the mail form from your mail template.  Create an agent (ie: called Deliver Mail that runs hourly or daily or whenever you want)

Here's the code to mail the documents in your new db:

Dim Session As New Notessession
     Dim SourceDb As NotesDatabase
     Dim Db As NotesDatabase
     Dim SourceView As Notesview
     Dim DestView As Notesview
     Dim SourceDoc As Notesdocument
     Dim DestDoc As Notesdocument
     Dim p As Variant
     Dim x As Variant
     Dim y As Variant
     Dim z As Variant
     Dim Tot As Integer
     Dim SourceDealNum As String
     Dim SourceLineNum As String
     Dim TotalPaid As String
     Dim Payment As Integer
     Dim NewDeal As String
     Set db = session.Currentdatabase
     
     Print("Started process")
     Set SourceDb = New NotesDatabase("server", "web\router.nsf")
     Set SourceView = SourceDb.GetView("Undelivered")
     SourceView.AutoUpdate = False
     Set SourceDoc = SourceView.GetFirstDocument
     
     While Not SourceDoc Is Nothing    
          Dim memo1 As New Notesdocument(Db)
          memo1.form = "Memo"
          memo1.Subject = SourceDoc.Subject
          memo1.SendTo = SourceDoc.SendTo
          memo1.CopyTo = SourceDoc.CopyTo
          memo1.BlindCopyTo = SourceDoc.BlindCopyTo
          Dim rtitemA As NotesRichTextItem
          Dim rtitemB As NotesRichTextItem
          Set rtitemA = SourceDoc.GetFirstItem( "Body" )
          Set rtitemB = memo1.CreateRichTextItem( "Body" )          
          Call rtitemB.AppendRTItem( rtitemA )        
          Call memo1.Send(False)
          Print("Mail Sent")        
          SourceDoc.Delivered = "Yes"
          Call SourceDoc.Save(True,True)
          Set SourceDoc = SourceView.GetNextDocument(SourceDoc)
     Wend
     
     Print("Completed successfully")

You could also do something similar in your mail file except you would have to turn the template off and you may not want to do that.  
0
 
LVL 5

Expert Comment

by:snocross
ID: 2760739
Important to remember:  if you schedule the agent to run on a server it will say the message is from the server.  If you want the message to appear as though it came from you then you will need to schedule the agent to run locally on your pc.
0
 
LVL 1

Accepted Solution

by:
DButler earned 50 total points
ID: 2761246
Here's a bit of a kludge, but it's fast and easy:

-- Create a folder called "System Folder" (or something similar -- maybe call it zzzSystem to sort it to the bottom of the list).

-- put ONE (and only ever ONE) document in the folder.  Give the document a subject like "SYSTEM DOCUMENT - DO NOT DELETE".

-- Create a scheduled agent that:
----- acts on "All documents in database"
----- IMPORTANT:  has a search criteria for the agent of "In folder" for your newly created system folder.
----- has a simple action (or formula if you wish) of "Send mail message." with the blanks filled in appropriately.

Because you use the a simple action or formula language, the message will appear to come from you and not the server.  If you use LotusScript, then head snocross' warning (but there are script ways around that, too).
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now