PHP Attaching an image to an email

前端 未结 6 837
滥情空心
滥情空心 2020-11-28 13:26

Is there a way to attach an image to an html formatted email message created in PHP?

We need to ensure that a corporate logo is on emails sent to clients who may not

6条回答
  •  没有蜡笔的小新
    2020-11-28 13:37

    Are you rolling your own, or using a prefab class? I recommend PHP Mailer[0] myself, and there's also PEAR::Mail_Mime[1] among others that Google would be happy to help you find. I've been using PHP Mailer to send messages with embedded images[2] for years without a hitch, though bear in mind that each image increases the email's bandwidth weight hugely, so generally it should not be used for anything in bulk. And to echo Bill, do make use of the text-only alternative too.

    [0] http://phpmailer.sourceforge.net/

    [1] http://pear.php.net/manual/en/package.mail.mail-mime.php

    [2] http://phpmailer.sourceforge.net/docs/PHPMailer/PHPMailer.html#AddEmbeddedImage

    taken from http://lists.evolt.org/archive/Week-of-Mon-20060612/183029.html

提交回复
热议问题