【问题标题】:unable to send images using html email in script task in ssis无法在 ssis 的脚本任务中使用 html 电子邮件发送图像
【发布时间】:2014-11-28 10:33:31
【问题描述】:

我有一个包裹,用于发送带有内嵌图片的电子邮件。我在包的脚本任务中使用 html 格式。

问题是,当我将别名设置为收件人时,我收到了预期的电子邮件。带有图像和字体。但是当我把我同事的别名作为收件人时,他得到的只是没有图片的html页面。

如果图像在我的本地机器上,他不应该在我从我的终端运行包并且图像在我的机器上可用时也获取图像吗?

【问题讨论】:

    标签: html ssis script-task


    【解决方案1】:
    ****it is not a good approach its better you put image on  some server and upload it and from there via  <img src""> embed into you email body.
    This way it will resolve the issue and a standardized way .****
    
    Other wise call the image through config file  and pass that value as a [parameter :
    
    <Configuration ConfiguredType="Property" Path="\Package.Variables     [User::EmbedImagePath].Properties[Value]" ValueType="String">
        <ConfiguredValue>**Path of the file** </ConfiguredValue>
      </Configuration>
    
    than in the script call this :
    lnkRes = New LinkedResource(Dts.Variables("EmbedImagePath").Value.ToString, System.Net.Mime.MediaTypeNames.Image.Jpeg)
                lnkRes.ContentId = "**Imagename**"
    
                altView = AlternateView.CreateAlternateViewFromString(varMailBody, Nothing, System.Net.Mime.MediaTypeNames.Text.Html)
                altView.LinkedResources.Add(lnkRes)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-10-31
      • 1970-01-01
      • 1970-01-01
      • 2022-01-08
      • 2014-08-04
      • 2015-08-01
      • 2018-09-08
      • 1970-01-01
      相关资源
      最近更新 更多