# Flash email form

**URL:** <https://forum.kirupa.com/t/flash-email-form/182637>\
**Category:** Uncategorized\
**Created:** [March 20, 2006, 7:04am UTC](https://forum.kirupa.com/t/flash-email-form/182637 "2006-03-20T07:04:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![drawven](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@drawven](https://forum.kirupa.com/u/drawven)\
**Post date:** [March 20, 2006, 7:04am UTC](https://forum.kirupa.com/t/flash-email-form/182637/1 "2006-03-20T07:04:20Z")

</div>

hi i just did the flash email form tutorial which is found [here](http://www.kirupa.com/developer/actionscript/flash_php_email.htm) my problem is that the emails sent to me look kinda like this

From : \<TEXTFORMAT LEADING=“2”\>  
Reply-To : \<TEXTFORMAT LEADING=“2”\>\<P ALIGN=“LEFT”\>\<FONT FACE=“Arial Black” SIZE=“12” COLOR="#999999" LETTERSPACING=“0” KERNING=“0”\>my name\</FONT\>\</P\>\</TEXTFORMAT\>  
Sent : Monday, March 20, 2006 1:45 AM  
To : [drawvennn@hotmail.com](mailto:drawvennn@hotmail.com)  
Subject : Reseravtion  
\<TEXTFORMAT LEADING=“2”\>\<P ALIGN=“LEFT”\>\<FONT FACE=“Arial Black”  
SIZE=“12” COLOR="#999999" LETTERSPACING=“0”  
KERNING=“0”\>testing\</FONT\>\</P\>\</TEXTFORMAT\>\<TEXTFORMAT LEADING=“2”\>\<P  
ALIGN=“LEFT”\>\<FONT FACE=“Arial Black” SIZE=“12” COLOR="#999999"  
LETTERSPACING=“0” KERNING=“0”\>testing 1 2\</FONT\>\</P\>\</TEXTFORMAT\>

none of it is clear it says the zize letterspacing and a whole bunch of other things as you can see. this is the php file i have  
\<?php  
$sendTo .= "drawven@gmail.com";  
$subject .= “Reservation”;  
$headers .= "From: " . $\_POST[“name”];  
$headers .= “\<” . $\_POST [“email”] . "\>  
";  
$headers .= "Reply-To: " . $\_POST[“email”] . "  
";  
$headers .= "Return-Path: " . $\_POST[“email”];  
$headers .= "Phone: " . $\_POST[“phone”];  
$message .= $\_GET[“address”]. "

". $\_GET[“city”]. "

". $\_GET[“zip”];  
mail($sendTo, $subject, $message, $headers);  
?\>  
i’m wondering, is this because of flash or the php? can anyone help me

---

<div class="post-metadata">

**Author:** ![SlowRoasted](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@SlowRoasted](https://forum.kirupa.com/u/SlowRoasted)\
**Post date:** [March 20, 2006, 2:47pm UTC](https://forum.kirupa.com/t/flash-email-form/182637/2 "2006-03-20T14:47:25Z")

</div>

Try adding the start and end tags for html and body to your message. Also try adding the content-type and mime type to your message.

---

<div class="post-metadata">

**Author:** ![drawven](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@drawven](https://forum.kirupa.com/u/drawven)\
**Post date:** [March 21, 2006, 4:11am UTC](https://forum.kirupa.com/t/flash-email-form/182637/3 "2006-03-21T04:11:28Z")

</div>

> [@SlowRoasted](#):
>
> Try adding the start and end tags for html and body to your message. Also try adding the content-type and mime type to your message.

how would i go about doing that?

---

<div class="post-metadata">

**Author:** ![realbass](https://avatars.discourse-cdn.com/v4/letter/r/a5b964/32.png) [@realbass](https://forum.kirupa.com/u/realbass)\
**Post date:** [March 21, 2006, 10:33am UTC](https://forum.kirupa.com/t/flash-email-form/182637/4 "2006-03-21T10:33:00Z")

</div>

1. Your php code is extremely insecure. You must check incoming data for validity, cuz somebody can exploit your form to send spam etc.
2. Its alot easier to use some special php library, like well-known [http://phpmailer.sourceforge.net/](http://phpmailer.sourceforge.net/)

---

<div class="post-metadata">

**Author:** ![SlowRoasted](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@SlowRoasted](https://forum.kirupa.com/u/SlowRoasted)\
**Post date:** [April 1, 2006, 12:47am UTC](https://forum.kirupa.com/t/flash-email-form/182637/5 "2006-04-01T00:47:42Z")

</div>

Im having the same problem. Did you ever get this fixed?

---

<div class="post-metadata">

**Author:** ![Ankou](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ankou/32/1351_2.png) [@Ankou](https://forum.kirupa.com/u/Ankou)\
**Post date:** [April 1, 2006, 2:14am UTC](https://forum.kirupa.com/t/flash-email-form/182637/6 "2006-04-01T02:14:09Z")

</div>

Interesting… If it’s a flash issue, I won’t be much help - _laugh_ that should be my standard disclaimer from now on 🙂

I’d check over your PHP code. It may not be an issue on your server (depending on the error level) but you should define your variables before you append to them.

Basically…

```php
$headers .= "From: " . $_POST["name"];
$headers .= "<" . $_POST ["email"] . ">
";
$headers .= "Reply-To: " . $_POST["email"] . "
";
$headers .= "Return-Path: " . $_POST["email"];

```

Should be…

```php
$headers = "From: " . $_POST["name"];
$headers .= "<" . $_POST ["email"] . ">
";
$headers .= "Reply-To: " . $_POST["email"] . "
";
$headers .= "Return-Path: " . $_POST["email"];

```

Notice the first line should not have a **.=** since you hadn’t defined the variable $header before. (Or at least not in the code you show)

Make sure that when you’re sending the mail that you send it the way you want it sent. If you’re trying to send the email as HTML then make sure to include a header with the correct content-type. Something like:

```php
$headers = 'MIME-Version: 1.0' . "
";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "
";
$headers .= "From: " . $_POST["name"];
$headers .= "<" . $_POST ["email"] . ">
";
$headers .= "Reply-To: " . $_POST["email"] . "
";
$headers .= "Return-Path: " . $_POST["email"];

```

For plain text I believe it’s: **Content-type: text/plain;**

---

<div class="post-metadata">

**Author:** ![SlowRoasted](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@SlowRoasted](https://forum.kirupa.com/u/SlowRoasted)\
**Post date:** [April 1, 2006, 2:46am UTC](https://forum.kirupa.com/t/flash-email-form/182637/7 "2006-04-01T02:46:58Z")

</div>

I got this working, I used the method in this thread to pass the variables to php. [http://www.kirupa.com/forum/showthread.php?t=207202&highlight=flash+email+form](http://www.kirupa.com/forum/showthread.php?t=207202&highlight=flash+email+form)

works fine now. For some stupid reason flash was formatting the text with html.
