我想在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