Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/oop/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powerbuilder 如何在PB8中发送邮件时抑制outlook弹出消息_Powerbuilder - Fatal编程技术网

Powerbuilder 如何在PB8中发送邮件时抑制outlook弹出消息

Powerbuilder 如何在PB8中发送邮件时抑制outlook弹出消息,powerbuilder,Powerbuilder,在PowerBuilder8中执行了一些操作之后,我正在尝试发送邮件。但它会弹出一条Outlook弹出消息,询问是否允许Outlook发送消息 有没有办法绕过这个弹出窗口直接发送邮件?如果答案是赎回,请让我知道在我下面的代码在哪里使用它- //string ls_name //integer id ls_name = sle_name.text id = integer(sle_id.text) dw_report.Saveas("d:\abc.xls", Excel!, True) ma

在PowerBuilder8中执行了一些操作之后,我正在尝试发送邮件。但它会弹出一条Outlook弹出消息,询问是否允许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 = 'priyadarsini_m01@infosys.com'
//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 
//字符串ls\u名称
//整数id
ls_name=sle_name.text
id=整数(sle_id.text)
dw_report.Saveas(“d:\abc.xls”,Excel!,True)
邮件会话MSE
邮件返回码
彩信
//创建邮件会话
mSes=创建邮件会话
//登录到会话
mRet=mSes.maillown(mailNewSession!)
如果mRet邮件返回成功!然后
MessageBox(“邮件”,“登录失败”。)
返回
如果结束
//填充mailMessage结构
mMsg.Subject=ls\u name
mMsg.NoteText='从PB接收邮件'
mMsg.Recipient[1]。名称='priyadarsini'_m01@infosys.com'
//mMsg.AttachmentFile[1]。文件='D:\EB130157\EB130157_22.doc'
mMsg.AttachmentFile[1]。文件类型=mailAttach!
mMsg.AttachmentFile[1]。文件名='abc.xls'
mMsg.AttachmentFile[1]。路径名='D:\abc.xls'
mMsg.AttachmentFile[1]。位置=1
//mMsg.Recipient[2]。姓名='Shaw,Sue'
//寄信
mRet=mSes.mailSend(mMsg)
如果mRet邮件返回成功!然后
MessageBox(“邮件发送”,“邮件未发送”)
返回
如果结束
mSes.mailLogoff()
摧毁小型企业

我认为这是Windows/Outlook中的一种安全设置,您无法从PowerBuilder中进行控制。

这其中有很多变量(例如,我认为Exchange server环境的安全设置与直接SMTP环境不同),而且随着时间的推移,情况也发生了变化。过去有一个OLE解决方案,称为Redemption,尽管我不知道它是否还相关

我知道我最近在Exchange环境中的Outlook 2010中遇到了类似的问题,此处的设置如下:

选项/信任中心/信任中心设置…/纲领性 通路

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

我认为这能解决你的问题吗?可能不会。这只是为了说明,在寻找解决方案时,您可能需要拓宽视野,并且您的起点可能应该是Outlook,而不是PowerBuilder。(如果微软已经完成了它的工作,那么你用任何工具都无法击败它的安全性,因此你最好尝试使用它,而不是对抗它。)


祝你好运。

谢谢你的建议谢谢你的建议