phpmysqlnewsletterphplist

PHPLIST include images in email – no external source


I use PHPLIST for my newsletter system and it works great so far.

I also created a tool to enter content for a newsletter on a easy way. Therefore I use my own form what finally creates a webpage.

This web page is imported over the regular "send webpage" function in PHPLIST what could be found on the page to create a new message.

Now when you go to step two php list imports the web page html content and uses it the same way as if entered in the editor.

So far everything works like a charm. Now let´s get to my question. When the content is imported all images get set with absolute urls. The same behaviour as if you set image in the WYSIWYG-Editor. However I really need to embed the images into the mailing so that the user does not need to load external resources. I know that the messages gets a little bigger than but I need it anyway.

Now I found a config setting "EMBEDUPLOADIMAGES" that should to the trick for uploaded images on the php list server but nothing for included content with the "send web page" option. Can somebody help me and show me how to import images even with the "send web page" option into my mailing?

Thank you


Solution

    1. Add this to your config.php file

      define("EMBEDUPLOADIMAGES",1);
      define('UPLOADIMAGES_DIR',"uploadimages");
      
    2. Create writeable uploadimages directory in your phpList root and upload images there

    3. Content of your html file should look like this, image source is just its filename

      <!-- Images must be directly in uploadimages directory, no subdirectories -->
      <div>
        <img src="image1.jpg" />
        <img src="image2.jpg" />
      <div>
      

    This works for me, phpList v3.0.12