Manage Learn to apply best practices and optimize your operations.

Send Email As If It Came From A Third Party.

Many times agents need to send email to users. This code snippet allows an
agent or user to send email as if it came from a third party.
Function SpoofMessage( Byval sendas As String, Byval sendto As String, subject
As String, message As String )
Dim session As New NotesSession
Dim current As NotesDatabase
Dim mailbox As New NotesDatabase("","")
Dim maildoc As NotesDocument
Dim rtitem As NotesRichTextItem

' get handle to mail.box on the users current mail server
Set current = session.CurrentDatabase
Call mailbox.Open( current.server, "mail.box" )

' Create a new document in the severs mail box
Set maildoc = mailbox.CreateDocument
maildoc.Form = "Memo"
maildoc.From = sendas
maildoc.SendFrom = sendas
maildoc.SendTo = sendto
maildoc.Recipients = sendto
maildoc.Subject = subject
Set rtitem = maildoc.CreateRichTextItem( "Body" )
Call rtitem.AppendText( message )
maildoc.PostedDate = Now()
maildoc.ComposedDate = Now()
maildoc.DeliveredDate = Now()
maildoc.Principal = sendas
maildoc.EncryptOnSend = False

Call maildoc.Save( True, False )

End Function

Dig Deeper on Lotus Notes Domino Administration Tools

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com'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 ...

SearchDataCenter

SearchContentManagement

Close