Problem with Flash/Php mail form:body of mail showing formatting

Hi all.

I kinda have a mail form working in flash, however when the e-mail turns up in my hotmail account, the body of the e-mail show the text formatting of the input boxes in flash

Here is what I get in my e-mail. Also the tel varible does not appear/please see php below this

<P ALIGN="LEFT"><FONT FACE="Myriad Pro" SIZE="14" COLOR="#B20606" LETTERSPACING="0" KERNING="0"></FONT></P><P ALIGN="LEFT"><FONT FACE="Myriad Pro" SIZE="14" COLOR="#B20606" LETTERSPACING="0" KERNING="0">This is a test of the work varible box</FONT></P>

<P ALIGN="LEFT"><FONT FACE="Myriad Pro" SIZE="14" COLOR="#B20606" LETTERSPACING="0" KERNING="0">This is a test of the name varible box,Darren</FONT></P>


<?php

$sendTo = "jonesdarren33@yahoo.com";
$subject = "Web Factory Site Reply";
$name = $_POST["name"];
$work = $_POST["work"];
$tel = $_POST["tel"];
mail($sendTo, $subject, $name, $work, $tel);
?>

How can I have the name, work and tel varible appear in the body of the e-mail without all the formatting? At the mo only the WORK and NAME varible are appearing within the formatting. I also want to add another varible called email, that I want to appear in the body, how do I add additional varibles to the body of the e-mail?

Can someone point out what I'm doing wrong in flash/php
In Flash:
Input text boxes have NOT been renderdd as HTML. Also tried with them rendered but no difference.
Fonts in  the input boxes have been embded as the contact form loads into a target movie clip that is masked, although I believe it's the PHP that is causing the formating problem?
B.T.W. :
Input text boxes in flash have the varibles: name, work, tel

Any help on this would be appricated

systems_mitsuiAsked:
Who is Participating?
 
steelseth12Connect With a Mentor Commented:
if your ip is accessible from outside your local network then you should get a warning  in hotmail to enable restricted content or something like that.
If its not accessible from the outside then you will have to upload it to your server in order for it to work.

Go to http://www.007ihost.com/ and register a free account upload the image to the server
and put

<img src="http://yourusername.007ihost.com/top.jpg">
0
 
steelseth12Commented:
<?php

$sendTo = "jonesdarren33@yahoo.com";
$subject = "Web Factory Site Reply";
$name = $_POST["name"];
$work = $_POST["work"];
$tel = $_POST["tel"];
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";


$body = $name.$work.$tel;

mail($sendTo, $subject, $body, $headers);
?>
0
 
nizsmoDeveloperCommented:
Try the following see if it works, basically you put in the message variable all the formatting you want for your email message body.
<?php
 
$sendTo = "jonesdarren33@yahoo.com";
$subject = "Web Factory Site Reply";
$name = $_POST["name"];
$work = $_POST["work"];
$tel = $_POST["tel"];
$message = $name . "<br>" . $work . "<br>" . $tel;
mail($sendTo, $subject, $message);
?> 

Open in new window

0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
steelseth12Commented:
the mail function takes 4 arguments .... email , subject , body , header

You need to specify in the header that you want to send an html email so that you get the formating and not the code.

Have a look at http://www.php.net/manual/en/function.mail.php
0
 
systems_mitsuiAuthor Commented:
Hi nizsmo/steelseth12;

Great work, took both of your advice and now got it working.
Just a few questions. The font is appearing as formatted in Flash; 12 point, in red. Ok for the contact form in flash, but can I change the size & colour for when it arrives in the email. Is there a way to change the php so the fonts are formatted say, to Arial black, 10?

Also, is there a way to put a j-peg/gif in the body of the mail, so it appears above the first header. I want to insert a logo.
Any ideas on how I would do that. I take it I would have the logo say, called logo.jpg in the same directory as the other files but would I need to add something to the code of the submit btn in flash or the php file?

0
 
steelseth12Commented:
<?php

$sendTo = "jonesdarren33@yahoo.com";
$subject = "Web Factory Site Reply";
$name = strip_tags($_POST["name"]);
$work = strip_tags($_POST["work"]);
$tel = strip_tags($_POST["tel"]);
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";




$body = <<<EOT

<!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>Page Title</title>
<style>
body {font-family:Arial; font-size:10px; color:#000000;}
</style>
</head>

<body>
<p> <img src="http://www.yoursite.com/logo.jpg"> </p>
<p> $name </p>
<p> $work </p>
<p> $tel </p>


</body>
</html>

EOT;


mail($sendTo, $subject, $body, $headers);



?>
0
 
systems_mitsuiAuthor Commented:
Hi, thank you for your excellent reply,

the formatting has worked, although where the jpg should be I have the symbol for an image.
not a red cross in a box that suggests broken path. I right clicked on the image square and selected show picture but nothing happened. I'm wondering if my hotmail account has limits on showing image?

Here is the php file I now have. Once again, thanks for you response.

B.T.W. top.jpg is in the same dir. as the php and flash html files.

<?php

$sendTo = "jonesdarren33@yahoo.com";
$subject = "Web Factory Site Reply";
$name = strip_tags($_POST["name"]);
$work = strip_tags($_POST["work"]);
$tel = strip_tags($_POST["tel"]);
$email = strip_tags($_POST["email"]);
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";




$body = <<<EOT

<!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>Page Title</title>
<style>
body {font-family:Arial; font-size:10px; color:#000000;}
</style>
</head>

<body>
<p> <img src="top.jpg"> </p>
<p> $name </p>
<p> $work </p>
<p> $tel </p>
<p> $email </p>

</body>
</html>

EOT;


mail($sendTo, $subject, $body, $headers);



?>


0
 
steelseth12Commented:
You need to put the full path to the jpg e.g http://www.yoursite.com/top.jpg
0
 
systems_mitsuiAuthor Commented:
Hi bud, I am testing internally and do not have a FQDN so put the id address of the server followed by the image name i.e.

<p> <img src="http://10.96.161.9/top.jpg"> </p>

It appears in the browser, when I browse to it, however when I test, the email deosn't come through.

PHP file:

<?php

$sendTo = "jonesdarren33@yahoo.com";
$subject = "Web Factory Site Reply";
$name = strip_tags($_POST["name"]);
$work = strip_tags($_POST["work"]);
$tel = strip_tags($_POST["tel"]);
$email = strip_tags($_POST["email"]);
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";




$body = <<<EOT

<!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>Page Title</title>
<style>
body {font-family:Arial; font-size:10px; color:#000000;}
</style>
</head>

<body>
<p> <img src="http://10.96.161.9/top.jpg"> </p>
<p> $name </p>
<p> $work </p>
<p> $tel </p>
<p> $email </p>

</body>
</html>

EOT;


mail($sendTo, $subject, $body, $headers);



?>


0
 
systems_mitsuiAuthor Commented:
Suberb, nice one!!!!
0
All Courses

From novice to tech pro — start learning today.