Computing.Net > Forums > Programming > Help with PHP mail html script

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Help with PHP mail html script

Reply to Message Icon

Name: fabwebdesigns
Date: October 30, 2008 at 20:52:46 Pacific
OS: vista
CPU/Ram: 4 megs ram
Product: Dell
Comment:

I have an online form that gets filled out and need to use
PHP mail html to process it. How do I get the $_POST['Name.Borrower' item to go into the table. Here's
my sample code:

<?php
et these paramaters-
-------------------------

// Subject of email sent to you.
$subject = 'Results from Application Intake';

// Your email address. This is where the form information
will be sent.
$to = 'whomever@yahoo.com';

$url = 'http://www.fabwebdesigns.com’;

//Process the $Post variables

$CopyWasSentTo = $_POST['CopyWasSentTo'];
$CopyWasAlsoSentTo = $_POST['CopyWasAlsoSentTo'];

//Process the post variables:
$fNameB = $_POST['Name.Borrower'];
$fBDOB = $_POST['DOB'];


//THE VAR NAME ABOVE SHOW’S UP AS ITSELF IN THE
TABLE BELOW WENT THE EMAIL IS DELIVERED (I.E IN THE
EMAIL IT WILL SAY “$fNameB” AND “Bob Smith” THE
VALUE PASSED TO IT BY $_POST['NAME.BORROWER']. SAME
THING FOR $FBDOB

// message
$message = '
<html>
<head>
<title>Results from Application Intake</title>
</head>
<body>

Results from Application Intake</p>
<table width="642" border="1" cellpadding="1"
cellspacing="1" bordercolor="#000000">
<tr>
<td width="210">Borrowers Name:</td>
<td width="419">$fNameB </td>
</tr>
<tr>
<td width="210">Borrowers DOB:</td>
<td width="419”> $fBDOB </td>
</tr>
</table>
</body>
</html>
';

// To send HTML mail, the Content-type header must be
set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-
8859-1' . "\r\n";
$headers .= "From: Application
Intake<info@fabwebdesigns.com>\r\n";
$headers .= "Cc: ".$CopyWasSentTo."\r\n";
$headers .= "Cc: ".$CopyWasAlsoSentTo."\r\n";

$mailSent = mail($to, $subject, $message, $headers);

echo '<META HTTP-EQUIV=Refresh CONTENT="0;
URL='.$url.'">';
?>

Fabwebdesigns.com



Sponsored Link
Ads by Google

Response Number 1
Name: tlserver
Date: October 31, 2008 at 09:46:58 Pacific
Reply:

Try something like this....

$message = "<td width="419">" & $fNameB & " </td>"


Basically breaking the HTML between " " and then connecting the variable with & variable & "continue html"


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Help with PHP mail html script

Help With PHP.....^&( www.computing.net/answers/programming/help-with-phpamp/6474.html

Help with: php, MySQL, database www.computing.net/answers/programming/help-with-php-mysql-database/8422.html

Help with forgot password script www.computing.net/answers/programming/help-with-forgot-password-script/13451.html