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

?>

Link to comment
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

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.