Skip to main content
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum

developerWorks

  

Sign in to participate PreviousPrevious NextNext


Marcel Muller 25.Oct.16 03:55 AM a Web browser
Notes Client All Releases All Platforms


Hello,

I have issue with my code and that is that mail is not saved in the "sent" view after I send it.

I am using lotus.notessession and here is the code:

Sub mailsendervar2(EmailRecipient As Variant, EmailSubject As String, pathToFile As String)

Dim Maildb As Object
Dim MailDoc As Object
Dim Body As Object
Dim Session As Object

'Start a session to notes
Set Session = CreateObject("Lotus.NotesSession")
'This line prompts for password of current ID noted in Notes.INI
'Call Session.Initialize
'or use below to supply password of the current ID
Call Session.Initialize("MYPASSWORD")
'Open the mail database in notes
Set Maildb = Session.GetDatabase("", "MYNSFFILE")
If Not Maildb.IsOpen = True Then
Call Maildb.Open
End If

'Create the mail document
Set MailDoc = Maildb.CreateDocument
Call MailDoc.ReplaceItemValue("Form", "Memo")
'Set the recipient
Call MailDoc.ReplaceItemValue("SendTo", EmailRecipient)
'Set subject
Call MailDoc.ReplaceItemValue("Subject", EmailSubject)
'Create and set the Body content
Set Body = MailDoc.CreateRichTextItem("Body")
Call Body.AppendText("")
'Example to create an attachment (optional)
Call Body.AddNewLine(2)
Call Body.EmbedObject(1454, "", pathToFile, "Attachment")
'Example to save the message (optional)
MailDoc.SaveMessageOnSend = True
'Send the document
'Gets the mail to appear in the Sent items folder
Call MailDoc.ReplaceItemValue("PostedDate", Now())
Call MailDoc.Send(False)
'Clean Up
Set Maildb = Nothing
Set MailDoc = Nothing
Set Body = Nothing
Set Session = Nothing

End Sub

The mail is sent correctly, but I want to save it in the sent view as well.






VBA Macro - how to save sent mail i... (Marcel Muller 25.Oct.16)
. . I think you need to save your docum... (Carl Tyler 25.Oct.16)
. . . . RE: I think you need to save your d... (Marcel Muller 26.Oct.16)
. . . . . . But I think you are doing this as a... (Carl Tyler 26.Oct.16)





  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

 Sign In or Register
Sign in
Forgot your password?
Forgot your user name?
Create new registration

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

Resources

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds

Wikis

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Connections Cloud Developers
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums


 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
IBM Connections
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
Lotus Enterprise Integration
Lotus Protector
Lotus Quickr
Lotus SmartSuite