通过 Axapta 发送电子邮件
我已经成功让我的 Axapta 3.0 通过 printjobSettings 类发送电子邮件。 但是,似乎没有任何地方可以为我的电子邮件创建正文。 目前,我可以发送带有附件的电子邮件,但我想包含一些文本,以便为收件人提供附件的一些上下文。
我怎样才能做到这一点?
I've managed to get my Axapta 3.0 to send email via the printjobSettings class. However, there doesn't appear to be anywhere I can create a body for my email. Currently I can send email with an attachment but I'd like to include some text to provide some context for the attachment for the recipient.
How can I accomplish this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
printJobSettings 类有一个方法 mailSubject 用于设置生成的电子邮件的主题,但没有用于设置消息正文的方法。 printJobSettings 是一个内核类,因此您无法修改它。
为了实际发送电子邮件,内核将 printJobSettings 对象传递给 Info.ReportSendMail 方法,您可以修改该方法。 因此,作为解决方法,请将主题和正文打包在主题中,然后在 ReportSendMail 中将它们解包。
在您的报告中:
在 Info.ReportSendMail 中:
The class printJobSettings has a method mailSubject for setting the subject of the email that gets generated, but there is no method for setting the body of the message. printJobSettings is a kernel class, so you can't modify it.
To actually send the email, the kernel passes a printJobSettings object to the method Info.ReportSendMail, which you can modify. So as a work around, pack your subject and body together in the subject, then unpack them in ReportSendMail.
In your report:
In Info.ReportSendMail: