Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save wgroenewold/97afae65ff5c1cf84e4eae1badaf1ed0 to your computer and use it in GitHub Desktop.
Save wgroenewold/97afae65ff5c1cf84e4eae1badaf1ed0 to your computer and use it in GitHub Desktop.
<?php
$body =
'<!--[if gte mso 9]>
<img src="cid:logo" width="300" height="400" />
<![endif]-->
<img style="mso-hide:all;" src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAetc." />';
$file = __DIR__ . '/btn1.png';
$uid = 'logo';
global $phpmailer;
add_action( 'phpmailer_init', function(&$phpmailer)use($file,$uid){
$phpmailer->SMTPKeepAlive = true;
$phpmailer->AddEmbeddedImage($file, $uid);
});
wp_mail('mail@example.com','Subject',$body);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment