【问题标题】:Azure functions to send email with logo using sendgridAzure 函数使用 sendgrid 发送带有徽标的电子邮件
【发布时间】:2020-10-30 01:39:45
【问题描述】:

我正在使用 python 和 sendgrid 从 Azure 函数发送电子邮件。我能够形成电子邮件的另一部分,但是当我尝试在电子邮件签名中插入徽标时,并没有显示该部分。其余 HTML 渲染良好。(直到 href)

以下是我的代码:

    import sendgrid
    from sendgrid import SendGridAPIClient
    from sendgrid.helpers.mail import Mail

    message = Mail(
                        from_email=email_from,
                        to_emails=email_to, 
                        subject=email_subject,

                        html_content= '<br>Hi '+name+ ','+
                        '<br>body of the email. Working fine.' +
                        '<br><a href='+no+'>No'</a>\n' +
                        '<br><br>LOGO--><img src="doc.png" alt="W3Schools.com"/>'+
                        '</html>'
                            )
    response = sg.send(message)
    print(response.status_code)

我也尝试在 src 中指出 URL,但没有帮助。

【问题讨论】:

标签: python azure-functions sendgrid


【解决方案1】:

有 3 个选项可以实现此目的:

  • CID 嵌入图像(内嵌图像)
  • 内联嵌入(Base64 编码)
  • 链接图片

查看以下链接了解实施详情:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-10-23
    • 1970-01-01
    • 2018-03-13
    • 2018-11-08
    • 1970-01-01
    • 2016-07-12
    • 1970-01-01
    相关资源
    最近更新 更多