Manage Learn to apply best practices and optimize your operations.

Send Email Through Outlook From Notes

Many of the enterprise solutions we have implemented involve sometype of
integration between the appplication we are introducing and the customer's
email system. If we are lucky the customer is using Notes as their messaging
system. Unfortunately, this is not always the case and we need to be able to
send from Outlook, or exchange, or some other messaging application. This code
was developed for such a purpose. For this example we are using Outlook 98 on
a Windows system but you could take this and use it (with some modification)
with any mail app.

This really works well for us, you can embelish this with adding attachments,
or sending without presenting to the enduser. We even have one customer where
we are sending the message with a word attachment that is protected for
revision on the fly.

You can really take this base code and go far with it!!

Good Luck!!
In an agent that is envoked by a form/view action or directly:

Initialize event:
Sub Initialize
Dim ws As New NotesUIWorkspace
Dim strMessageType As String

Set UIdoc = ws.currentDocument
UIdoc.AutoReload = False 'improves performance
Set doc = UIdoc.document

Call ForegroundOutlook()

End Sub

ForegroundOutlook Event:
Sub ForegroundOutlook ()
Const BYVALUE = 1 'this is used to attach the actual document not a link
for outlook

'Get an outlook application object
Set objSession = CreateObject("Outlook.Application")

'Create a new message
Set objMessage= objSession.CreateItem(olMailItem)

'Display the message interface to the user

'Set the subject and message fields
Subject$ = "This is the subject text fo this message"
Message$ = "This is the body text for this message"
QNumber = doc.ordernumber(0)

'The intPosition is used to determine the placement of the attachment in
the message. It is set the space
'immediately following the message.
intPosition = Len(Message$) + 1

Set objRecipient = objMessage.Recipients.Add (sendto)
objMessage.subject = Subject$
objMessage.Body = Message$

'NOTE: there is no send code since that will be done by the user when
'they complete editing / reviewing the message.

Exit Sub

End Sub
This was last published in November 2000

Dig Deeper on Domino Resources - Part 6

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...