# Embedding inline images with phpmailer

**URL:** <https://forum.kirupa.com/t/embedding-inline-images-with-phpmailer/217683>\
**Category:** Uncategorized\
**Created:** [March 1, 2007, 12:54am UTC](https://forum.kirupa.com/t/embedding-inline-images-with-phpmailer/217683 "2007-03-01T00:54:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jazgold](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@jazgold](https://forum.kirupa.com/u/jazgold)\
**Post date:** [March 1, 2007, 12:54am UTC](https://forum.kirupa.com/t/embedding-inline-images-with-phpmailer/217683/1 "2007-03-01T00:54:15Z")

</div>

i really dislike how most mail clients will not display images in emails that are referenced remotely. ok, maybe they’re protecting me from my stupidity… but … argh.

so i’d like to attach the image, and i’ve found documentation for doing so using phpmailer.php:

```auto
require_once("class.phpmailer.php");
$mail = new PHPMailer(); $mail->AddEmbeddedImage('glenn_header.jpg','header','header','base64','image/jpeg');

```

and then in the actual body i just reference it as such

```auto
<img src="cid:header'>

```

but every time i try this, it fails.

in fact, i can’t seem to get phpMailer to work at all… is it possible that with my yahoo business account, i don’t have access to it? or that, god forbid, they don’t even have it installed?

i can certainly send out emails using the basic:

```auto
mail($sendtoemail, $subject, $mailBody, $headers);

```

but i haven’t found any way to attach files through this basic mail function. is there a way to attach and embed images inline through this more bare bones function?

so i’m missing something simple. perhaps it’s just that i can’t use the phpMailer class. wtf yahoo?

thanks in advance homies
