Dynamic HTML Table in PHP Mail -


i wanted know can can include user defined function in php mail

$to = "example@example.com"; $message = '<html>'; $message .='</html>'; $from = "webmaster@example.com"; $headers = 'mime-version: 1.0' . "\r\n"; $headers .= 'content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "from:" . $from; 

i tried above code , message '< /html>'(without quotes) in mail. , function gets printed on screen. dont want function printed on screen want function run , contents mailed user. btw function dynamically generated html table mysql database. i've searched on internet couldn't find specific answer.

chances displaywineslist() function echo's data instead of returning it.

you can either mod function return data or leave as-is , use output buffering capture data:

$to = "example@example.com"; $subject = "winestore query"; ob_start(); displaywineslist($connection, $query,$region_name, $wine_type, $price); $message = ob_get_clean(); $message = '<html>'.$message.'</html>'; $from = "webmaster@example.com"; … 

to know please post displaywineslist() function.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -