My Mail is defined like that
$this->mail = new PHPMailer();
$this->mail->IsSMTP();
$this->mail->CharSet = 'UTF-8';
$this->mail->Host = '';
$this->mail->SMTPAuth = true;
$this->mail->Port = 465;
$this->mail->SMTPSecure = 'ssl';
$this->mail->Username = '';
$this->mail->Password = '';
$this->mail->From = '';
$this->mail->FromName = '';
$this->mail->WordWrap = 78;
switch( is_array( $address ) )
{
case false: $this->mail->addAddress( $address ); break;
case true : foreach( $address as $addr ) { $this->mail->addAddress( $addr ); } break;
}
$this->mail->addEmbeddedImage($_SERVER['DOCUMENT_ROOT']."/image/icon/logo-f39200.svg", "logo-f39200", 'logo-f39200.svg' );
$this->mail->IsHTML(true);
$this->mail->Body = $msg;
$this->mail->Subject = $subject;
And I want to put an svg image inside it but It don’t work, here’s my body :
$message = '
<html>
<head>
<title>
Lorem lorem
</title>
</head>
<body>
<div style="height:300px;border:1px solid red;display:flex; flex-direction:column; justify-content:flex-start; align-items:center"> //The style tag was here for test
<h2>Lorem</h2>
<div>
<p>
Lorem lorem lorem lorem
</p>
</div>
<img src="cid:logo-f39200" alt="logo"/>
</div>
</body>
</html>';
I try with :
- src=”cid:logo” + addEmbeddedImage //I got the attachment but no image in the body of the mail
- src=”absolute path” + addEmbeddedImage //I got the attachment but no image
- src=”aboslute path” //I got nothing
- addEmbeddedImage //I got the attachement only
Don’t know what I miss, thanks in advance