如何存储 XP_SMTP 邮件结果代码消息?
我试图记录通过 xp_smtp 邮件组件发送的所有电子邮件,但我不知道如何存储消息。 因为失败而存储 1 对我来说没有多大好处。
DECLARE @rc INT
EXEC @rc = master.dbo.xp_smtp_sendmail...
--Once the email is sent put the results (pass or fail) into another table:
EXEC pr_InsertEmailLog @Body, @From, @Subject, @To, @rc, 'Error MESSAGE here'
I am trying to keep a record of all of the emails that get sent via xp_smtp mail component, but I don't know how to store the message. Storing a 1 because it failed doesn't do me much good.
DECLARE @rc INT
EXEC @rc = master.dbo.xp_smtp_sendmail...
--Once the email is sent put the results (pass or fail) into another table:
EXEC pr_InsertEmailLog @Body, @From, @Subject, @To, @rc, 'Error MESSAGE here'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
文档说它只返回 0 或 1。
但是,进一步它提到了输出消息参数的计划工作
YMMV,但某些善良的灵魂可能会比这个版本进一步开发它。
The documentation say it only returns 0 or 1.
However, further down it mentions planned work with an output message parameter
YMMV, but some kind soul may have developed it further then this release.