參考資料:How to send Lotus Notes mail messages with Microsoft Visual Basic
我將其改寫成使用PHP寄信:
<?
//Initiate Lotus Notes session
$session = new COM( "Lotus.NotesSession" );
$session->Initialize("你的密碼");
//Get database handle
$Maildb = $session->getDatabase( “”, “你的mail的nsf,可以參考前面的文章取得” );
$MailDoc = $Maildb->CREATEDOCUMENT();
$MailDoc->ReplaceItemValue(“Form”, “Memo”);
$MailDoc->ReplaceItemValue(“sendto”, “stephen.liu@tpo.biz”);
$MailDoc->ReplaceItemValue(“Subject”,”測試”);
$Body = $MailDoc->CREATERICHTEXTITEM(“Body”);
$Body->APPENDTEXT(“Body text here”);
//Example to create an attachment (optional)
$Body->ADDNEWLINE(2);
$Body->EMBEDOBJECT(1454, “”, “附件檔案的路徑”, “Attachment”);
$MailDoc->SEND(False);
?>