Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Send a mail through a lotus domino server using powershell

555 views
Skip to first unread message

Nukem@discussions.microsoft.com Pako Nukem

unread,
Jan 23, 2009, 7:18:01 AM1/23/09
to
Hello,

I'm trying to create and send a mail in a remote lotus domino server
mail.box. I have created a working visual basic script for this, but in
powershell i don't know how to call the "appenditemvalue" method for a lotus
notes document object. Please, could you provide me any solution for this?
Thanks!!

(these are my source code for the scripts)l

---PS---
$notes = New-Object -comobject Lotus.NotesSession
$notes.initialize("Password")
$maildb = $notes.GetDatabase("Server", "mail.box")
if ($maildb.isopen)
{$memodoc = $maildb.createdocument
$memodoc.AppendItemValue("Form", "Memo")
$memodoc.appenditemvalue("SendTo", "john...@mailserver.com")
$memodoc.appenditemvalue("Recipients", "john...@mailserver.com")
$memodoc.appenditemvalue("From", "peterg...@mailserver.com")
$memodoc.appenditemvalue("Principal", "peterg...@mailserver.com")
$memodoc.appenditemvalue("Subject", "My subject")
$memodoc.save(True, False)
$memodoc.Send(False)}


---VBS---
Set session = CreateObject("Lotus.NotesSession")
session.initialize("Password")
Set maildb = session.GetDatabase("Server", "mail.box")
If maildb.isopen Then
Set memodoc = maildb.CreateDocument
Call memodoc.AppendItemValue("Form", "Memo")
Call memodoc.appenditemvalue("SendTo", "john...@mailserver.com")
Call memodoc.appenditemvalue("Recipients", "john...@mailserver.com")
Call memodoc.appenditemvalue("From", "peterg...@mailserver.com")
Call memodoc.appenditemvalue("Principal", "peterg...@mailserver.com")
Call memodoc.appenditemvalue("Subject", "My Subject")
Call memodoc.save(True, False)
Call memodoc.Send(False)
End If

Marco Shaw [MVP]

unread,
Jan 23, 2009, 8:09:57 AM1/23/09
to
Pako Nukem wrote:
> Hello,
>
> I'm trying to create and send a mail in a remote lotus domino server
> mail.box. I have created a working visual basic script for this, but in
> powershell i don't know how to call the "appenditemvalue" method for a lotus
> notes document object. Please, could you provide me any solution for this?
> Thanks!!
>

Answered here perhaps:
http://powershellcommunity.org/Forums/tabid/54/aff/5/aft/3602/afv/topic/Default.aspx

--
*Microsoft MVP - Admin Frameworks
https://mvp.support.microsoft.com/profile/Marco.Shaw
*Co-Author - Sams Windows PowerShell Unleashed 2nd Edition (due December
15th, 2008)
*PowerShell Co-Community Director - http://www.powershellcommunity.org
*Blog - http://marcoshaw.blogspot.com

Pako Nukem

unread,
Jan 26, 2009, 6:10:02 AM1/26/09
to

"Marco Shaw [MVP]" wrote:

Thanks, you are right, it is also necessary this change for the document
creation:

$memodoc = $maildb.createdocument()

0 new messages