使用 cron - php 帮助处理内联图像/邮件?
我有一些邮件需要使用 cron 发送。当我手动加载脚本时,一切正常。使用 cron 我得到了损坏的图像。
为了更改我使用的 img 的 src:
$body = eregi_replace("managersrc_logo","images/managers/acertainlogo.jpg",$body);
因为我认为使用绝对路径很重要,所以我也尝试过:
$body = eregi_replace("managersrc_logo","http://www.site.com/images/managers/acertainlogo.jpg",$body);
在这种情况下,当我手动运行 cronscript 时,我什至看不到图像。自动 cron 也不会向我显示图像。
当我检查收到的邮件来源时,即使我使用绝对路径,我总是看到“cid:加密的东西”?这是为什么?我只想在 img 标签的 src 属性中打印我的绝对路径。谁改变了我的 cid: 绝对路径?是 php、phpmailer 还是 Outlook 本身?
有帮助吗?
I've got mailings that need to be sended using cron. When I load the script manualy all works fine. With cron i get broken images.
to change the src of my img i used:
$body = eregi_replace("managersrc_logo","images/managers/acertainlogo.jpg",$body);
Because i thaught that it is importent to use absolute paths i also tried:
$body = eregi_replace("managersrc_logo","http://www.site.com/images/managers/acertainlogo.jpg",$body);
In that case i even do not see the images when i run the cronscript manualy. Nor the automated cron will display me the images.
When i check the source of the mail that is received i always see "cid:encryptedstuff" even if i use absolute paths? Why is that? I just want my absolute paths being printed in the src attribute of the img tag. Who changes my absolute path to cid: ? is it php, phpmailer or outlook itself?
Any help someone?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以在替换之前和之后(但在发送之前)发布示例 html 吗?也许它有其他字符会破坏 URL,即 src="/managersrc_logo"。另外,也许您的邮件程序有一个选项可以将图像集成到邮件中,但找不到它们?
can you post a sample html before and after being replaced (but before being sent)? maybe it has additional characters that break the url, ie src="/managersrc_logo". Also, maybe your mailing program has an option to integrate the images inside the message and can't find them?
问题是 phpmailer 的旧版本。我更新到新版本,现在图像显示完美!
The problem was an older version of phpmailer. I updated to the new version and the images are displayed perfectly now!!