
E-MAIL
A 5.04 mailing list template error fix
Gabor Katus 11.07.2000
Rating: --- (out of 5)




|
When you receive a memo from a 5.04 mailing list, the document will occur in the Draft and Inbox folders simultaneously and it opens in edit mode.
The cause is that PostedDate item is missing, and therefore the document is handled nearly as a draft.
This problem can be simply corrected. In the SendMail procedure of Process New Mail agent you have to do the following :
1. Allocate a worker variable 'dt' of Notesdatetime class
2. Actualize it by calling SetNow
3. To enhance Notes Friendliness, assign the Localtime property (or any nonempty string, if date/time of posting is not important) to an additional PostedDate item in the new memo.
Here's the code of corrected Sendmail. To be short the central part is missing. Additional code lines are preceeded by comments containing the denotation '***'
CODE:
Sub SendMail (subject As String, body As String, recipients As String, whofrom As String)
' Subroutine to create email messages directly
'in the mail.box for router to deliver
'Setup sane logic
On Error Goto HandleError
'Allocate worker vars.
Dim session As NotesSession
Dim db As NotesDatabase
Dim Memobody As NotesRichTextItem
Dim object As NotesEmbeddedObject
' *** this is line is added
Dim dt As New Notesdatetime ("")
' *** the middle part of original code is cut from here ***
'Set Various memo control fields for Notes Friendliness
' *** With the next two code lines
' *** you can set PostedDate
Call dt.SetNow
memo.PostedDate = dt.Localtime
memo.Form = "Memo"
memo.From = whofrom
memo.Subject = subject
memo.MailFormat = "T"
memo.DeliveryPriority = "High"
memo.deliveryReport = "O"
Call memo.save(True,False)
Done:
On Error Goto Bail
'Misc post processing goes here
Exit Sub
HandleError:
'Aggh something fail put error on browser so it can be spotted
Dim status As String
status$ = "Error! " & Err() & " at line " & Erl() & ": " & Error()
Messagebox(status$)
Resume Done
Bail:
status$ = "Error " & Err() & " at line " & Erl() & ": " & Error()
Messagebox(status$)
Resume BailOut
BailOut:
End Sub
 |

|
|
 |
|
 |