acctman Posted August 18, 2007 Share Posted August 18, 2007 can someone help me with formating the body section for the Php Mail fuction. I'm not sure how to include the for arrays into the body. I want the output for the body to look like this. From: UserName ReportedUser: UserName Message: wewew wewew wewe w wew ew wewe <insert space> Logs: ertert ret ert r et ert er ert er t <?php $body /* need help insering into $body $fromUser = $_POST["fromUser"]; $reportedUser = $_POST["reportedUser"]; $message = $_POST["message"]; $logs = $_POST["logs"]; */ $body="<em>HTML</em> formatted <strong>Message</strong"\n; $headers = "From: Owner <noreply@domain.com> \r\n"; $headers.= "Content-Type: text/html; charset=ISO-8859-1 "; $headers .= "MIME-Version: 1.0 "; /*notice there aren't any \r\n after the second two header additions. This is what made this version work correctly*/ mail("admin@domain.com", "Reported Chat User", $body, $headers); ?> Quote Link to comment https://forums.phpfreaks.com/topic/65595-solved-php-mail-function/ Share on other sites More sharing options...
NArc0t1c Posted August 18, 2007 Share Posted August 18, 2007 uh.. $body .= 'From: UserName\n'; $body .= 'ReportedUser: UserName\n'; $body .= 'Message: wewew wewew wewe w wew ew wewe\n'; $body .= '\nLogs: ertert ret ert r et ert er ert er t'; Quote Link to comment https://forums.phpfreaks.com/topic/65595-solved-php-mail-function/#findComment-327521 Share on other sites More sharing options...
acctman Posted August 18, 2007 Author Share Posted August 18, 2007 no that's how i want the output to be, i want to add to $body how do i put $fromUser, $reportedUser, $message, $logs into $body * need help inserting into $body $fromUser = $_POST["fromUser"]; $reportedUser = $_POST["reportedUser"]; $message = $_POST["message"]; $logs = $_POST["logs"]; and the printout formated like this From: UserName ReportedUser: UserName Message: wewew wewew wewe w wew ew wewe <insert space> Logs: ertert ret ert r et ert er ert er t Quote Link to comment https://forums.phpfreaks.com/topic/65595-solved-php-mail-function/#findComment-327564 Share on other sites More sharing options...
ILYAS415 Posted August 18, 2007 Share Posted August 18, 2007 Try... $body=" Message From: $fromUser Reported User: $reportedUser Message: <b>$message</b> Logs: $logs "; like that? Quote Link to comment https://forums.phpfreaks.com/topic/65595-solved-php-mail-function/#findComment-327567 Share on other sites More sharing options...
acctman Posted August 18, 2007 Author Share Posted August 18, 2007 Try... $body=" Message From: $fromUser Reported User: $reportedUser Message: <b>$message</b> Logs: $logs "; like that? everything is being printed on 1 line Quote Link to comment https://forums.phpfreaks.com/topic/65595-solved-php-mail-function/#findComment-327580 Share on other sites More sharing options...
ILYAS415 Posted August 18, 2007 Share Posted August 18, 2007 u mean its being outputted like... Messagefrom: blablaReported User:blablaMessage:blablablaLogs:logshere ? if so then use... $body=" Message From: $fromUser<br> Reported User: $reportedUser<br> Message: <br> <b>$message</b><br> Logs: $logs<br> "; Quote Link to comment https://forums.phpfreaks.com/topic/65595-solved-php-mail-function/#findComment-327585 Share on other sites More sharing options...
acctman Posted August 18, 2007 Author Share Posted August 18, 2007 thanks ILYAS415 for all the help. I learned a little bit more about php today Quote Link to comment https://forums.phpfreaks.com/topic/65595-solved-php-mail-function/#findComment-327614 Share on other sites More sharing options...
ILYAS415 Posted August 18, 2007 Share Posted August 18, 2007 no problem Quote Link to comment https://forums.phpfreaks.com/topic/65595-solved-php-mail-function/#findComment-327621 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.