2013-10-31 42 views
0

发送邮件我有下面的代码的HTML文件:SQL Server和超级链接

<html> 
<head> 
<style type="text/css"> 
.row { vertical-align: top; height:auto !important; } 
.list {display:none; } 
.show {display: none; } 
.hide:target + .show {display: inline; } 
.hide:target {display: none; } 
.hide:target ~ .list {display:inline; } 
@media print { .hide, .show { display: none; } } 
</style> 
</head> 
<body> 
<div class="row"> 
    <a href="#hide1" class="hide" id="hide1">Expand</a> 
    <a href="#show1" class="show" id="show1">Collapse</a> 
    <div class="list"> 
    <ul> 
    <li>Item 1</li> 
    <li>Item 2</li> 
    <li>Item 3</li> 
    </ul> 
    </div> 
</div> 
</body> 
</html> 

当我打开使用资源管理器,Firefox或Chrome此文件;扩展器超链接正常工作。但是当我使用SQL Server的数据库邮件发送此代码时,扩展器超链接无法正常工作。

我使用下面的代码从数据库发送邮件。

execute msdb.dbo.sp_send_dbmail 
     @Profile_name = 'Support', 
     @recipients = @Recipients, 
     @subject = 'Database Report', 
     @body_format = 'HTML', 
     @body = @Htmlbody 

我想每天从sql server发送邮件报告并希望在其上使用扩展器。

回答

0

此问题不太可能与SQL Server相关。电子邮件html标记有很多限制。它强烈依赖于电子邮件客户端(Gmail,Outlook等)。例如,你不能使用只有内联样式的类。所以你不能只在浏览器中浏览好的html页面并将它作为电子邮件发送。我建议你阅读一些电子邮件的HTML标记教程。