我正在使用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,但這並没有帮助。
最新回復
- 7月前1 #
There are 3 options to achieve this:
CID Embedded Images (Inline Images)
Inline Embedding (Base64 Encoding)
Linked Images
查看以下鏈接以了解實施细节:
https://sendgrid.com/blog/embedding-images-emails-facts/
https://github.com/sendgrid/sendgrid-python/issues/736
如果您需要更多详细資訊/說明,請告诉我。