Hi all,
I am developing a newsletter. There are some elements included with picture an text. It is running well except including the image. I have tried the code below. The path ist correct.
Addtional I have tried to use WWW_ROOT instead of $SERVER_NAME.
Any tipps??
foreach ($elements as $element) {
$message .= '<div class="body_element">';
$message .= '<h4>';
$message .= $element->title;
$message .= '</h4>';
$message .= '<div class = "element_body" > ';
$picture = 'https://' . $_SERVER['SERVER_NAME'].'/img/' . $element->path . '/' . $element->image;
$this->log($picture);
$link = '<tr><td align="left" style="background-image:url('.$picture.')"></td>';
$this->log($link);
$message .= $link;
$message .= '<td style="font-size:0.9em;">';
$message .= $element->text;
$message .= '</td></tr>';
$message .= '</div>';
$message .= '</div> ';
$message .= '<hr>';
}