2016-07-07 1 views
0

SQL Server에서 데이터베이스 메일을 사용 중이며 전자 메일을 보내려고합니다. 나는 테스트를 목적으로이 간단한 HTML 메시지를 만들었습니다SQL Server 데이터베이스 메일 : Outlook 및 gmail에서 HTML이 렌더링되지 않습니다.

declare @body nvarchar(1000) 
 
select @body = 
 

 
'<html><body> 
 
<h3>Test Email</h3> 
 
<table border="1"> 
 
<tr> 
 
    <th>ID </th> 
 
    <th>Name</th> 
 
</tr> 
 
<tr> 
 
    <td>1</td> 
 
    <td>John</td> 
 
</tr> 
 
<tr> 
 
    <td>2</td> 
 
    <td>Marry</td> 
 
</tr> 
 
</table> 
 
</body></html>' 
 

 
EXEC msdb.dbo.sp_send_dbmail @recipients = '[email protected]' 
 
, @subject = 'Test', @body = @body, @reply_to = '[email protected]', 
 
@from_address = '[email protected]', @profile_name= 'My SMTP'

그러나, HTML은 모두 아웃룩 2013의 Gmail에 렌더링되지 않습니다. 표시 내용 : enter image description here

왜 작동하지 않습니까?

+0

답변을

EXEC msdb.dbo.sp_send_dbmail @recipients = '[email protected]' , @subject = 'Test', @body = @body, @body_format='HTML', @reply_to = '[email protected]', @from_address = '[email protected]', @profile_name= 'My SMTP' 

실행 코드 snippetCopy 조각을 HTML로 body_format 속성을 설정 – ElenaDBA

답변

1

내가 대신 일반 텍스트의 HTML로 또 하나 개의 속성을 설정해야합니다 생각

관련 문제