Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


sending email through notes using vbscript

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,34817
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> sending email through notes using vbscript
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 sending email through notes using vbscript - 5/23/2006 9:38:50 AM   
  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
 
 
Post #: 1
 
 RE: sending email through notes using vbscript - 5/24/2006 1:44:43 AM   
  brianfgonzalez

 

Posts: 29
Score: 0
Joined: 8/23/2004
From: USA
Status: offline
bump for assistance

_____________________________

Brian Gonzalez
Call Center Desktop Technician
brian.gonzalez@cc.partsearch.com

(in reply to brianfgonzalez)
 
 
Post #: 2
 
 RE: sending email through notes using vbscript - 5/24/2006 4:52:48 AM   
  kirrilian


Posts: 628
Score: 3
Joined: 3/15/2005
From:
Status: offline
perhaps you could use the sendkeys object to get rid of the password prompt
then the shell object to kill the notes process after youre done

_____________________________

Have you searched here ?
VBScript Fundamentals
My Site

(in reply to brianfgonzalez)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> sending email through notes using vbscript Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts