我想在PowerBuilder 8中執行一些操作後發送郵件,但彈出Outlook彈出消息詢問是否允許Outlook發送消息。如何在PB8中發送郵件時彈出Outlook彈出消息
有什麼辦法可以繞過這個彈出並直接發送郵件?如果答案是贖回,請讓我知道在哪裏可以使用它在我下面的代碼 -
//string ls_name
//integer id
ls_name = sle_name.text
id = integer(sle_id.text)
dw_report.Saveas("d:\abc.xls", Excel!, True)
mailSession mSes
mailReturnCode mRet
mailMessage mMsg
// Create a mail session
mSes = create mailSession
// Log on to the session
mRet = mSes.mailLogon(mailNewSession!)
IF mRet <> mailReturnSuccess! THEN
MessageBox("Mail", 'Logon failed.')
RETURN
END IF
// Populate the mailMessage structure
mMsg.Subject = ls_name
mMsg.NoteText = 'Recieved Mail From PB'
mMsg.Recipient[1].name = '[email protected]'
//mMsg.AttachmentFile[1].file = 'D:\EB130157\EB130157_22.doc'
mMsg.AttachmentFile[1].FileType = mailAttach!
mMsg.AttachmentFile[1].FileName = 'abc.xls'
mMsg.AttachmentFile[1].PathName = 'D:\abc.xls'
mMsg.AttachmentFile[1].position = 1
//mMsg.Recipient[2].name = 'Shaw, Sue'
// Send the mail
mRet = mSes.mailSend(mMsg)
IF mRet <> mailReturnSuccess! THEN
MessageBox("Mail Send", 'Mail not sent')
RETURN
END IF
mSes.mailLogoff()
DESTROY mSes
感謝您的建議 – user3588800 2014-12-15 06:59:23