doutangxi2144 2018-12-13 06:25
浏览 252

PHP / Laravel - 将图形保存为图像/嵌入图像到电子邮件HTML正文(谷歌图表或其他)

I've been using Ruby on Rails at work for years. My job changed. PHP server inherited. Have extended it to include Laravel. Have just started learning Laravel.

What I need to get done, right now, is I need to start sending automated scheduled emails, with graph images embedded in the email HTML body. I've been doing a lot of searches and this seems like the path to follow for sending automated emails (without being able to spend money on something like FusionCharts for this):

  1. Use Google Charts Printing PNG Charts to save graphs as PNG images on the server
  2. Use Pears Mail_Mime::addHTMLImage() function to embed the saved graph pngs into (I've never used Pear before).
  3. Delete images files after email is sent

What I'm looking for is some advice on exactly what path I should follow. What I'd really love to find is some complete sample code that's a working example of saving a chart (google or other) as an image file and then embedding that file into an email HTML body.

Thanks for any help. Since I'm just barely starting to learn Laravel, I'm not sure if Laravel has anything that would make this easier than plain PHP.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥35 平滑拟合曲线该如何生成
    • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
    • ¥15 名为“Product”的列已属于此 DataTable
    • ¥15 安卓adb backup备份应用数据失败
    • ¥15 eclipse运行项目时遇到的问题
    • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
    • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
    • ¥15 自己瞎改改,结果现在又运行不了了
    • ¥15 链式存储应该如何解决
    • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站