Jump to content

[SOLVED] PHP Mail function


acctman

Recommended Posts

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 <[email protected]> \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("[email protected]", "Reported Chat User", $body, $headers); 
    

?>

Link to comment
https://forums.phpfreaks.com/topic/65595-solved-php-mail-function/
Share on other sites

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

 

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>
";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.