Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Need help on the PHP HTML Email format
Old 05-17-2009, 07:56 AM Need help on the PHP HTML Email format
Average Talker

Posts: 25
Trades: 0
I created a mail script in PHP that shows the HTML format. However, when I received the output of it from Outlook, it shows me some weird characters or  . Is there a way to subsitute the html format to still make it look a like a table but eliminate the weird characters?

I just need the output to look like the following below:

Name: Susan Myers
Location: California


Thanks,
tgmiller5 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-17-2009, 08:53 AM Re: Need help on the PHP HTML Email format
Extreme Talker

Posts: 177
Trades: 0
can you show us the mail script?
kbfirebreather is offline
Reply With Quote
View Public Profile
 
Old 05-17-2009, 09:16 AM Re: Need help on the PHP HTML Email format
Skilled Talker

Posts: 84
Trades: 0
You will have to set the content-type: text/html
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
- 1-888-869-HOST(4678)
Award winning Managed Hosting -
Please login or register to view this content. Registration is FREE

Managed Dedicated Servers. Reseller Discounts. 24/7 Impressive Tech Support
HivelocityDD is offline
Reply With Quote
View Public Profile
 
Old 05-17-2009, 08:39 PM Re: Need help on the PHP HTML Email format
Average Talker

Posts: 25
Trades: 0
That has been but here is the code

I created a mail that shows the HTML format. However, when I received the output of it from Outlook, it shows me some weird characters or  . Is there a way to subsitute the html format to still make it look a like a table but eliminate the weird characters?
Thanks,


I created a mail that shows the HTML format. However, when I received the output of it from Outlook, it shows me some weird characters or  . Is there a way to subsitute the html format to still make it look a like a table but eliminate the weird characters?
Thanks,
<?

// config for tes

// request file variables
/**/
$file1 = $_POST['file1'];
$file2 = $_POST['file2'];
$file3 = $_POST['file3'];
$file4 = $_POST['file4'];
$file5 = $_POST['file5'];


for($counter = 1; $counter < 6; $counter++) {
if (!empty($_FILES['file'.$counter]['name'])){

$uploadfile = $uploaddir . $_FILES['file'.$counter]['name'];

if (move_uploaded_file($_FILES['file'.$counter]['tmp_name'], $uploadfile)) {
} else {
echo "There was an error uploading your file - contact the intranet administrator";
print "Here's some debugging info:\n";
print_r($_FILES);
}

// end file checker
}

// end for loop
}

if (count($HTTP_POST_VARS) <= 1){
echo "phpmailer v0.1";
exit;
}


$mailto = "hello@aol.com";

/*
foreach($comm_array AS $key => $community){
$community_output .= $community_masterarray[$key].",";
}
$community_output = rtrim($community_output,",");
}else{
$community_output = "None Specified";
}
*/
/* vars */
$subject = "Form";
$fromname = "Test";
$fromaddress = "hello@aol.com";
$goto_success = "http://www.yahoo.com";
$msgfooter = "Test";
$msgheader = "PR Date";
$msgheader1 = "Date t";
//$skip = array("h_fromaddress","h_fromname","h_subject","h_ msgheader","h_msgfooter","h_mailto","h_gotosuccess ","communities");
$message .= $msgheader . "<BR><br>\r\n";
$message .= $msgheader1 . "<br>\r\n";
$message .= date("l, F d , Y");
$message .= '<br><br>';


while(list($key, $val) = each($HTTP_POST_VARS)){

// $message = $message . "<b>". $key . " : " ."</b>" . $val . "<BR>\r\n";
//$message .= "<html>\n";
//$message .= "<body style=\"font-family: Times New Roman, Arial, Geneva, sans-serif; font-size:12px; color:black;\">\n";
//$message .= "<body>\n";
$message .= "<table width=\"400\" height=\"60\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" >";
//1st section
$message .="<tr>";
$message .="<td height=\"2\" colspan=\"4\" bgcolor=\"#00000\"></td>";
$message .="<tr>";
$message .="<td width=\"1%\"></td>";
$message .="<td colspan=\"2\">&nbsp;</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>-</td>";
$message .="<td width=\"100\"><b>Contact</b></td>";
$message .="<td>:</td>";
$message .="<td>$Contact</td>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>EAddress</b></td>";
$message .="<td>:</td>";
$message .="<td>$EmailAddress</td>";
$message .="</tr>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>Request</b></td>";
$message .="<td>:</td>";
$message .="<td>$ReBy</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>Dept</b></td>";
$message .="<td>:</td>";
$message .="<td>$Department</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>PNumber</b></td>";
$message .="<td>:</td>";
$message .="<td>$PNumber</td>";
$message .="</tr>";
//2nd section
$message .="<tr>";
$message .="<td width=\"1%\"></td>";
$message .="<td colspan=\"2\">&nbsp;</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>-</td>";
$message .="<td width=\"100\"><b>DraftDue</b></td>";
$message .="<td>:</td>";
$message .="<td>$DtDue</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<br>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>DFinal Due</b></td>";
$message .="<td>:</td>";
$message .="<td>$DFDue</td>";
$message .="</tr>";
$message .="<br>";
//3rd section
$message .="<tr>";
$message .="<td width=\"1%\"></td>";
$message .="<td colspan=\"2\">&nbsp;</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>-</td>";
$message .="<td width=\"100\"><b>PName</b></td>";
$message .="<td>:</td>";
$message .="<td>$PName</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>Audience</b></td>";
$message .="<td>:</td>";
$message .="<td>$Audience</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>Distributed</b></td>";
$message .="<td>:</td>";
$message .="<td>$Distributed</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>NProject</b></td>";
$message .="<td>:</td>";
$message .="<td>$NProject</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b> Last Updated</b></td>";
$message .="<td>:</td>";
$message .="<td>$tLastUpdated</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>Type of Project</b></td>";
$message .="<td>:</td>";
$message .="<td>$TProject</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>Project</b></td>";
$message .="<td>:</td>";
$message .="<td>$project</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>Main Message</b></td>";
$message .="<td>:</td>";
$message .="<td>$MainMessage</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>Objective</b></td>";
$message .="<td>:</td>";
$message .="<td>$Objective</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>Comments</b></td>";
$message .="<td>:</td>";
$message .="<td>$Comments</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>PDescription</b></td>";
$message .="<td>:</td>";
$message .="<td>$PDescription</td>";
$message .="</tr>";
//4th section
$message .="<tr>";
$message .="<td width=\"1%\"></td>";
$message .="<td colspan=\"2\">&nbsp;</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>Size</b></td>";
$message .="<td>:</td>";
$message .="<td>$Size</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>URL</b></td>";
$message .="<td>:</td>";
$message .="<td>$URL</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>S2</b></td>";
$message .="<td>:</td>";
$message .="<td>$S2</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>Select</b></td>";
$message .="<td>:</td>";
$message .="<td>$Select</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>Quantity</b></td>";
$message .="<td>:</td>";
$message .="<td>$Q</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>FFormat</b></td>";
$message .="<td>:</td>";
$message .="<td>$FFormat</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>Other</b></td>";
$message .="<td>:</td>";
$message .="<td>$Other</td>";
$message .="</tr>";
//5th section
$message .="<tr>";
$message .="<td width=\"1%\"></td>";
$message .="<td colspan=\"2\">&nbsp;</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>Budget</b></td>";
$message .="<td>:</td>";
$message .="<td>$PBudget</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>ACode </b></td>";
$message .="<td>:</td>";
$message .="<td>$PCode</td>";
$message .="</tr>";
//6th section
$message .="<tr>";
$message .="<td width=\"1%\"></td>";
$message .="<td colspan=\"3\">&nbsp;</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>-</td>";
$message .="<td width=\"100\"><b>Location</b></td>";
$message .="<td>:</td>";
$message .="<td>$Company</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>Contact</b></td>";
$message .="<td>:</td>";
$message .="<td>$Contact</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>EmailAddress</b></td>";
$message .="<td>:</td>";
$message .="<td>$EAddress</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>Mailing Address</b></td>";
$message .="<td>:</td>";
$message .="<td>$MAddress</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>If Yes, where</b></td>";
$message .="<td>:</td>";
$message .="<td>$yes</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>posted</b></td>";
$message .="<td>:</td>";
$message .="<td>$Posted</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>Completed Files </b></td>";
$message .="<td>:</td>";
$message .="<td>$CFiles</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>If Other</b></td>";
$message .="<td>:</td>";
$message .="<td>$If2</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td width=\"100\"><b>Phone</b></td>";
$message .="<td>:</td>";
$message .="<td>$Phone</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td>&nbsp;</td>";
$message .="<td><b>Instructions</b></td>";
$message .="<td>:</td>";
$message .="<td>$Instructions</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td height=\"4\" colspan=\"4\" bgcolor=\"#000000\"></td>";
$message .="</tr>";
$message .="</table>";
$message .= "</body>\n";
//$message .= "</html>\n";

//$message .= "Data: ".$community_output. "<BR>\r\n";
$message .= $msgfooter . "<BR>\r\n";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: $fromname <$fromaddress>\r\n";

#autoresponse
$messagear = "Thank you....";
mail($_POST["EmailAddress"], "Test Autoresponse",$message, $headers);

# mail
//included is a line to have a copy sent to client email address
if (mail($Email_Address, $subject,$message, $headers))
if (mail($mailto, $subject,$message, $headers)){
if (isset($goto_success)){
#header("Location: " . $goto_success);


?>
<html>
<head>
<script language="JavaScript">
<!--hide from old browsers
var time = null
function move() {
window.location = 'http://www.yahoo.com'
}
//-->
</script>
</head>
<body onLoad="timer=setTimeout('move()',4000)">
<p>Thank you for your submission. </p>
<br>
-Test Services
</body></html>
<?
} else {
echo "Message Sent...";
}
}
?>
tgmiller5 is offline
Reply With Quote
View Public Profile
 
Old 05-18-2009, 08:29 AM Re: Need help on the PHP HTML Email format
Banned

Posts: 81
Location: kavoir.com
Trades: 0
First, you can just use one $message = "

all the HTML code goes here

";

Second, you may want to try htmlentities($variable_containing_HTML) in replacement of those variables.
yangyang is offline
Reply With Quote
View Public Profile Visit yangyang's homepage!
 
Reply     « Reply to Need help on the PHP HTML Email format
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.26210 seconds with 12 queries