Jump to content

Recommended Posts

I am trying to get this php script to recognize this var as a variability and not text when I send this e-mail.

it is so when I send the mail it will look like a forum and contain the input variability .

I have a page send the var to php through form action.

 

I am not doing a good job explaining this.

 

 

 

 

 

 

!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>sending</title>

</head>

<?php

$headers  = 'MIME-Version: 1.0' . "\r\n";

$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

$Message = 

'

<table width="225" border="1" cellpadding="1" cellspacing="1" bordercolor="#000000" bgcolor="#999900">

    <tr>

      <td width="215"><strong>Name</strong>:' $_GET['name']';

  </td>

    </tr>

    <tr>

      <td><label><strong>City</strong>:

   

</label></td>

    </tr>

    <tr>

      <td><label><strong>State:</strong>

       

</label></td>

    </tr>

    <tr>

      <td><label><strong>Zip:</strong>

       

        <br />

      </label></td>

    </tr>

    <tr>

      <td><strong>Phone:</strong>

   

    </tr>

    <tr>

      <td><label><strong>e-mail: </strong>

   

      </label></td>

    </tr>

    <tr>

      <td><label><strong>Info:</strong>

      </label></td>

    </tr>

  </table>

</p>

  ';

$MessageSent = mail('email@emial.com', $Subject, $Message,$headers);

if ($MessageSent) {

echo "<p>The following message was sent successfully:</p><hr />";

echo "<p><strong>From</strong>:$From</p>";

echo "<p><strong>To</strong>:$state</p>";

echo "<p><strong>Subject</strong>:$zip</p>";

echo "<p><strong>phone</strong>:$phone</p>";

echo "<p><strong>email</strong>:$email</p>";

echo "<p><strong>info</strong>:$info</p>";

}

else

echo"<p>The Message was not sent successfully!</p>";

?>

 

<body>

</body>

</html>

 

Link to comment
https://forums.phpfreaks.com/topic/128629-solved-need-some-help-with-html-mail/
Share on other sites

do you mean like this ?

 

!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>sending</title>
</head>
<?php
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$name = $_GET['name'];
$Message =  
'
<table width="225" border="1" cellpadding="1" cellspacing="1" bordercolor="#000000" bgcolor="#999900">
    <tr>
      <td width="215"><strong>Name</strong>:'.$name.'
  	</td>
    </tr>
    <tr>
      <td><label><strong>City</strong>:
     
</label></td>
    </tr>
    <tr>
      <td><label><strong>State:</strong>
        
</label></td>
    </tr>
    <tr>
      <td><label><strong>Zip:</strong>
        
        <br />
      </label></td>
    </tr>
    <tr>
      <td><strong>Phone:</strong>
     
    </tr>
    <tr>
      <td><label><strong>e-mail: </strong>
     
      </label></td>
    </tr>
    <tr>
      <td><label><strong>Info:</strong>
      </label></td>
    </tr>
  </table>
</p>
  ';
$MessageSent = mail('email@emial.com', $Subject, $Message,$headers);
if ($MessageSent) {
echo "<p>The following message was sent successfully:</p><hr />";
echo "<p><strong>From</strong>:$From</p>";
echo "<p><strong>To</strong>:$state</p>";
echo "<p><strong>Subject</strong>:$zip</p>";
echo "<p><strong>phone</strong>:$phone</p>";
echo "<p><strong>email</strong>:$email</p>";
echo "<p><strong>info</strong>:$info</p>";
}
else
echo"<p>The Message was not sent successfully!</p>";
?>

<body>
</body>
</html>

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.