| |
brianfgonzalez
Posts: 29
Score: 0
Joined: 8/23/2004
From: USA
Status: offline
|
I have a working script to send emails through lotus notes, I just have the following issues: 1. Need to get rid of password prompt that appears when lotus notes opens when sending email 2. Need to close notes after email is sent On Error Goto 0: sendLNMail() Dim s Dim db Dim doc Dim rtitem Dim subj Dim bdy Dim recips(2) 'File System Object Decs Dim fs Dim fName Dim path Sub sendLNMail() On Error Resume Next '/////////////////////////////////////// ' //////////////////////////////// 'Begin Error/Input Routines 'Created by Steven Jacobs '2004 '/////////////////////////////////////// ' //////////////////////////////// 'Get subject...if no subject, exit sub subj = "this is the subject.." bdy = "This is the body text.. " '/////////////////////////////////////// ' //////////////////////////////// 'End Error/Input Routines '/////////////////////////////////////// ' //////////////////////////////// Set s = createobject("Notes.NotesSession") if s Is Nothing Then MsgBox "Could Not Create A Session Of Notes",16,"Notes Session Error." endMe Exit Sub End if 'See if we can create the main object (session) if Err.Number <> 0 Then On Error Goto 0 MsgBox "Could Not create session 'Lotus Notes' from object" Exit Sub End if Set db = s.getdatabase(s.getenvironmentstring("MailServer",True),s.getenvironmentstring("Mailfile",true)) 'See if we can a handle on the mail file ' if Err.Number <> 0 Then On Error Goto 0 MsgBox "Could find or Get a handle on the mail file" Exit Sub End if Set doc = db.createdocument Set rtitem = doc.createrichtextitem("BODY") recips(1) = "brian.f@blahblah.com" recips(2) - "briango@blahblah.com " With doc .form = "Memo" .subject = subj .sendto = "briango@blahblah.com Brian" .copyto = "brian.f@blahblah.com Brian" .body = bdy .postdate = Date End With call rtitem.embedobject(1454,"",fName) doc.visible = True doc.send False 'if we made it this far, alert the user the mail memo has been created and sent MsgBox "You message has been created and sent." & chr(13) & "Thank you.",64,"Message Sent Notification." endMe End Sub Sub endMe() 'clean objects/memory s.close Set s = nothing Set db = nothing Set doc = nothing Set rtitem = nothing Set fs = nothing End Sub
_____________________________
Brian Gonzalez Call Center Desktop Technician brian.gonzalez@cc.partsearch.com
|
|