2014-12-05 63 views
1

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

回答

1

我相信,这是在Windows/Outlook中的安全设置,这是不是你可以在PowerBuilder控制。

+0

感谢您的建议 – user3588800 2014-12-15 06:59:23

1

这里有很多变数(例如,我认为Exchange服务器环境与直接SMTP相比,这是不同的),并且事情随着时间而改变。过去有一种叫做赎回的OLE解决方案,虽然我不知道它是否相关。

我知道我在Outlook 2010中在Exchange环境中最近碰到了这样的问题,在这里设置:

选项/信任中心/信任中心设置... /编程 访问

被设置为“当我的防病毒软件处于非活动状态或过期时警告我有关可疑活动”,并告诉我用户的防病毒软件已过期。修复防病毒问题导致提示消失。

我认为这会解决您的问题吗?可能不会。这只是为了说明您可能需要扩大自己的视野以寻求解决方案,并且您的起点应该是Outlook,而不是PowerBuilder。 (如果微软已完成其工作,有什么你可以用任何工具来打败它的安全性做的,所以你最好努力工作它,而不是它。)

好运。

+0

感谢您的建议 – user3588800 2014-12-15 06:58:37