I stored the images in url format in database.now i want to send mail with multiple images using mail() in php
$sql11 = "SELECT `photo_id`, `project_id`, `map_id`, `map_flag`, `user_id`, `photo_path`, `pdf_path`, `created_at`, `modified_at` FROM `photos` WHERE map_flag='Task' and map_id='$task_id'";
$rl = $conn->query($sql11);
while ($res11 = mysqli_fetch_assoc($rl)) {
$array[] = [$res11['photo_path']];
}
$str = implode(',', $array);
$message = $message_content . "
" . "
" . "
" . $message1 . "
" . $message2 . "
" . $message3 . "
" . $message4 . "
" . $message5 . "
" . $message6 . "
" . $array . "
" . $message8 . "
";
$from = "123@test.com";
$headers = 'From: ' . $from . "
";
$result = mail($to, $subject, $message, $headers);
First off, you need to tell the email app that this is html. This can be done by adding the line
$headers .= "Content-type: text/html; charset=UTF-8";
Next, what is photo_path
? Does it also include the full url or a relative url? You need to set the full url i.e. http://example.com/{$res11['photo_path']}