简体   繁体   English

在SQL Server sp_send_dbmail中指定附件的内容类型

[英]specify content type of an attachment in sql server sp_send_dbmail

How can I specify the content type of an attachment when sending emails using sp_send_dbmail ? 使用sp_send_dbmail发送电子邮件时,如何指定附件的内容类型 The content type is specified as application/octet-stream for Zip, PDF files. 内容类型被指定为Zip,PDF文件的application / octet-stream But I need to change it to application/zip , application/pdf . 但是我需要将其更改为application / zipapplication / pdf

The "file_attachments" parameter takes absolute paths of the attachments. “ file_attachments”参数采用附件的绝对路径。 Can not find a place to specify content type. 找不到指定内容类型的地方。

I am using SQL Server 2005/2008 我正在使用SQL Server 2005/2008

Please help. 请帮忙。 Thanks 谢谢

This can't be done. 无法做到这一点。 If you need to specify content types, you'll have to use another method for sending mail. 如果需要指定内容类型,则必须使用另一种发送邮件的方法。

A SQL Agent job triggering a script/executable in the language of your choice is probably the simplest solution. 使用您选择的语言触发脚本/可执行程序的SQL Agent作业可能是最简单的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM