如何在PB8中发送邮件时抑制Outlook弹出消息 [英] How to supress the outlook pop up message while sending mails in PB8

查看:71
本文介绍了如何在PB8中发送邮件时抑制Outlook弹出消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在PowerBuilder 8中进行了一些操作后尝试发送邮件.但它弹出一个Outlook弹出消息,询问是否允许Outlook发送消息.

I am trying to send mail after doing some operations in PowerBuilder 8. But it pops up an Outlook pop up message asking whether to allow Outlook to send message or not.

有没有办法绕过这个弹窗直接发送邮件?如果答案是赎回,请在下面的代码中告诉我在哪里使用它-

Is There any way to bypass this pop up and send mail directly? If the answer is redemption please let me know where to use it in my below code-

//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 

推荐答案

这其中有很多变数(例如,我认为 Exchange 服务器环境与直接 SMTP 相比有所不同),并且随着时间的推移情况发生了变化.曾经有一个名为 Redemption 的 OLE 解决方案,尽管我不知道它是否相关.

There's a lot of variables in this (e.g. I believe this is different for Exchange server environments compared to direct SMTP), and things have changed over time. There used to be an OLE solution for this called Redemption, although I don't know if it's relevant anymore.

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

I know I ran into a problem like this recently in Outlook 2010 in an Exchange environment, and the settings here:

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

Options / Trust Center / Trust Center Settings ... / Programmatic Access

设置为当我的防病毒软件处于非活动状态或已过期时,就可疑活动向我发出警告",并告诉我我的用户的防病毒软件已过期.修复防病毒问题使提示消失.

was set to "Warn me about suspicious activity when my antivirus software is inactive or out-of-date", and told me that my user's antivirus was considered out of date. Fixing the antivirus problem made the prompts go away.

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

Do I think this will solve your problem? Probably not. It's only meant to illustrate that you probably need to broaden your horizons in search of a solution, and that your starting point should probably be Outlook, as opposed to PowerBuilder. (If Microsoft has done its job, there's nothing you can do with any tool to defeat it's security, so you're better off trying to work with it instead of against it.)

祝你好运.

这篇关于如何在PB8中发送邮件时抑制Outlook弹出消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆