can u tell me how to send a file or photo through mail that should appear when the mail is opened.i tested sending photos as attachments but it appeared as attachment and it required downloading file to see the photo.please can u reply if u know. thank you.

Dani AI

Generated

— the problem you described usually comes down to how the image is sent, not the mail client alone. Replies from , and point in the right direction; this note expands on the practical options and common pitfalls so a photo (or an animated GIF) appears inline instead of showing only as a downloadable attachment.

There are two common ways to make an image display inline. One is to host the image on a web server and have the message reference it; the other is to embed the image inside the message itself using MIME so the mail contains the picture. If an image is attached with a Content-Disposition of "attachment" many clients will treat it as a downloadable file. To embed, the message should include the image part with a Content-ID and Content-Disposition set to "inline" so mail clients can render it as part of the message body.

A minimal example of the embedded-image MIME headers (image content omitted) looks like:

Content-Type: image/gif; name="photo.gif"
Content-Transfer-Encoding: base64
Content-ID: <photo1>
Content-Disposition: inline; filename="photo.gif"
[base64 image data here]

Notes and cautions: animated GIFs are the most widely supported way to include animation inside email; CSS/JavaScript animations are not reliable. Some clients block remote images or strip certain inline formats for privacy/security, so always provide a static fallback and keep file size small. Use HTTPS-hosted images if referencing remotely, test across major clients (Gmail, Outlook, Apple Mail, mobile apps), and consider an ESP or library that supports embedded images (they handle correct MIME structure and headers). For protocol background see the MIME multipart documentation and the data-URI discussion (MIME, Data_URI_scheme) and read client-imaging behavior (for example, Gmail image handling) ().

Recommended Answers

All 3 Replies

Try HTML, I haven't tried HTML some time but I gues it was

<img src="[imagepath]" />

I dunno wether it works staight away in E-mails. Try searching and testing it.

yeh html encoded emails are your best bet.

Yes, that's fine. If you're sending an e-newsletter via a server-side script, be sure to set the doctype of the page to HTML. You don't want people to receive plain text emails that are full of html code that is unparsed.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.