Jump to content

Removing embedded images in mail script


brianlange

Recommended Posts

I have an email popping script that needs to remove embedded images.

The images have "cid" in the source attribute like this one.

<img width="83" height="95" src=

"cid:[email protected]" align="left" />

 

This is what I have so far which seems to work. Any way I can approve upon this? Thanks in advance.

 

 

$regEx = '/<img[\w\W]+src=[\r\n]?["\']cid[\w\W]+\s(\/>|>)/';

 

$img = '<img width="83" height="95" src=

"cid:[email protected]" align="left" />';

 

$img = preg_replace($regEx, '', $img);

Link to comment
https://forums.phpfreaks.com/topic/194945-removing-embedded-images-in-mail-script/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.