# Image embedded in email also becomes an attachment

**URL:** https://discuss.python.org/t/image-embedded-in-email-also-becomes-an-attachment/46585
**Category:** Python Help
**Created:** [February 21, 2024, 11:41pm UTC](https://discuss.python.org/t/image-embedded-in-email-also-becomes-an-attachment/46585 "2024-02-21T23:41:02Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Jakomesco](https://avatars.discourse-cdn.com/v4/letter/j/bb73d2/32.png) [@Jakomesco](https://discuss.python.org/u/Jakomesco)
#### Post date: [February 21, 2024, 11:41pm UTC](https://discuss.python.org/t/image-embedded-in-email-also-becomes-an-attachment/46585/1 "2024-02-21T23:41:03Z")

</div>

A script that is correctly embedding inline images in HTML emails, is also adding the images as attachments. How can I eliminate this second copy of each image?

```python
# Attach Any Images
images = '''/Users/me/Desktop/RKw.jpeg\n/Users/me/Desktop/logo.png'''.splitlines()
I=1
for image in images:
	# print 'Image',i,': ',image,'\n'
	fp = open(image, 'rb')
	msgImage = MIMEImage(fp.read())
	fp.close()
	# Define the image's ID as referenced above
	msgImage.add_header('Content-ID', '<image'+str(i)+'>')
	msg.attach(msgImage)
	I+=1

```
