$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: testing <test@gmail.com>' . "\r\n";
$subject = "testing";
$content = "
//html content
question How to use foreach loop inside this ?
";
$sent=mail("test@gmail.com",$subject,$content,$headers);
Jiby_1
0
Light Poster
Recommended Answers
Jump to PostYou use it outside and just add the variable that carries the result of the loop, for example:
$rows = ''; foreach($result as $row) $rows .= " <tr> <td>{$row['article']}</td> <td>{$row['price']}</td> </tr> "; $content = " <p>Display order list:</p> <table> <thead> <tr> <th>Item</th> <th>Price</th> </tr> </thead> <tbody> {$rows} …
All 4 Replies
cereal
1,524
Nearly a Senior Poster
Featured Poster
Jiby_1
0
Light Poster
Jiby_1
0
Light Poster
Jiby_1
0
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.