关于 gmail:Laravel 将图像嵌入电子邮件中,在 Apple Mail 中将图像显示为实际大小 | 珊瑚贝

Laravel embed image into email shows image as actual size in Apple Mail


我正在通过 Mailgun 从我的 laravel 应用程序发送一封电子邮件。我正在使用嵌入功能,以便图像会在阻止图像时显示 Gmail,但现在我遇到了 Apple Mail 的问题,如果我设置图像宽度和高度,它会忽略这一点并在其位置显示图像真实文件大小。因此,如果我有一个宽度和高度为 100 像素的图像,并在我的电子邮件中将宽度和高度设置为 50 像素,Apple Mail 会忽略它,但 Gmail 会按预期将其显示为 50 像素。 Apple Mail 的任何解决方法?当不使用 Laravel 中的嵌入功能时,Apple Mail 将其显示为正确的大小。

1
<img src=”{{ $message->embed(public_path() . ‘/img/mail/logo.png’) }}” width=”22″ height=”22″ style=”max-width: 22px;-ms-interpolation-mode: bicubic;vertical-align: middle;border: 0;line-height: 100%;height: auto;outline: none;text-decoration: none;” />

提前致谢!

-杰米

  • 你试过把它放在一个div里吗? <img src=”…” style=”width:100%;”>
  • 是的,我试过了:(


改变你的代码,不要在标签中使用宽度和高度属性。使用风格。我希望这能解决您的问题。

1
<img src=”{{ $message->embed(public_path() . ‘/img/mail/logo.png’) }}” style=”width:22px; height:22px; max-width: 22px;-ms-interpolation-mode: bicubic;vertical-align: middle;border: 0;line-height: 100%;height: auto;outline: none;text-decoration: none;” />

  • 虽然这应该可行,但您可能会在 Outlook 桌面中遇到问题(您是否测试过它们?)。因此,我建议除了样式之外还使用 width 属性。


来源:https://www.codenong.com/61564874/

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_8661.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?