if ($stmt->execute()) { while ($row = $stmt->fetch()) { $body_message .= $row['domin']; $body_message .= " <br/>"; } } $to = '<[email protected]'; $subject = 'the subject'; $message = $body_message; $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); if(mail($to, $subject, $message, $headers)) { echo "SEND!!!"; }