跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[问与答] email 的 html 到底应该怎么排版啊

发表于

之前是没搞定用 python+smtp+gmail 发信

根据这个这个帖子 https://v2ex.com/t/1049187 的建议,用 https://github.com/kootenpv/yagmail 搞定了。

现在有了 邮件 html 的排版问题。

我先是用了这个 https://github.com/leemunroe/responsive-html-email-template 模板,啥都不改直接发出去,在 iPhone 的邮件客户端,Thunderbird 客户端,以及 gmail web 客户端上看起来都有问题。

主要是段落间间距巨大,而且邮件顶部也有巨大的空白,后面有截图。

发信的代码大概就是

yag.send(
    to='recipient@example.com',
    contents=['path/to/email.html'],
)

然后我在 thunderbird 客户端里直接把 npm 发给我的邮件另存为 html ,然后用 yagmail 发出去,同样排版问题。

NPM 的邮件 npn email

我发出去的样子,行间距莫名其妙地大,而且最顶上图标上下都有莫名其妙的巨大空白 my email

已经被搞破防了,这邮件的排版怎么这么难搞。有没有什么工具可以辅助的呀?

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.