0
SQLストアドプロシージャを使用して簡単なHTML電子メールを送信しようとしています。 メールの結果に会社ロゴなどの画像を追加することはできますか?SQLを使用して電子メールを送信する画像を追加
これはストアドプロシージャの一部です。
/*Create HTML*/
SET @TableHTML =
N'<H4>Production Alert (' + CONVERT(VARCHAR(10),GETDATE(),101) + ')</H4>' +
N'<table border="1">' +
N'<tr>' +
N' <td>Company</td>' +
N' <td width="70" align="CENTER">Department</td>' +
N' <td width="70" align="CENTER">Target</td>' +
N' <td width="70" align="CENTER">Shipped</td>' +
N' <td width="70" align="CENTER">Achievement by Yesterday</td>' +
N' <td width="70" align="CENTER">Achievement for this month</td>' +
N' <td width="70" align="CENTER">Difference</td>' +
N' <td width="70" align="CENTER">Catch Up QTY</td>' +
N'</tr>' +
CAST ((SELECT td = a.CompanyName, '', 'Right' AS "td/@align",
td = DepartmentName, '', 'Left' AS "td/@align",
td = ForecastQtyAcc, '', 'Right' AS "td/@align",
td = ShippedQtyAcc, '', 'Right' AS "td/@align",
td = ThePercentage, '', 'Right' AS "td/@align",
td = ThePercentageAll, '', 'Right' AS "td/@align",
td = TheDiff, '', 'Right' AS "td/@align",
td = CatchUpQTY, ''
FROM #Monthdata a
FOR XML PATH('tr'), TYPE
) AS NVARCHAR(MAX)) +
N'</table>' ;
DROP TABLE #Monthdata
/メールでそれ/ SET @TableHTML = @TableHTML + N '' + N ''