4
3

More than 5 years have passed since last update.

【誰得】nyagosからLotus Notes経由でメール送信

Posted at

最近NotesのCOMコンポーネントがあることを知り、
またnyagosが外部DLLなしでOLEをサポートしたこともあり
仕事をさぼって休み時間を利用して書いてみました。

.nyagos
nyagos.alias.send_mail_via_notes = function(args)
    local server = "YOUR/SERVER"
    local dbfile = "YOUR/DBFILE.nsf"
    local sess = nyagos.create_object("Lotus.NotesSession")
    sess:Initialize()
    local db = sess:GetDatabase(server, dbfile, false)
    local doc = db:CreateDocument()
    doc:ReplaceItemValue("SendTo", args[1])
    doc:ReplaceItemValue("Subject", args[2])
    local body = doc:CreateRichTextItem("Body")
    body:AppendText(args[3])
    body:AddNewLine(2)
    body:AppendText("from nyagos via Lotus Notes")
    doc:Send(false)
end
使い方
$ send_mail_via_notes your_mail_address@your.server.com "foobar" "hogefuga"
4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3