# Sending E-mail through a Form Created in Flash?

**URL:** <https://forum.kirupa.com/t/sending-e-mail-through-a-form-created-in-flash/6739>\
**Category:** Uncategorized\
**Created:** [October 15, 2002, 1:23pm UTC](https://forum.kirupa.com/t/sending-e-mail-through-a-form-created-in-flash/6739 "2002-10-15T13:23:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kelly\_Nunes](https://avatars.discourse-cdn.com/v4/letter/k/b5e925/32.png) [@Kelly\_Nunes](https://forum.kirupa.com/u/Kelly_Nunes)\
**Post date:** [October 15, 2002, 1:23pm UTC](https://forum.kirupa.com/t/sending-e-mail-through-a-form-created-in-flash/6739/1 "2002-10-15T13:23:59Z")

</div>

I am new to Flash and have experienced several problems already. Now I have a new one. I created a Flash website and one of the pages has a contact form with Flash pushbutton components (Submit/Clear) in them. I know how to send form mail in regular HTML pages using CGI mailers, but how do you do it in Flash MX? Do I need PHP/ASP/MySQL or something? Can someone out ther please help

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 15, 2002, 2:42pm UTC](https://forum.kirupa.com/t/sending-e-mail-through-a-form-created-in-flash/6739/2 "2002-10-15T14:42:14Z")

</div>

OK, I’ve never used CGI, but I’m pretty sure that you can send Flash variables to a CGI script. All you have to do is send the variables to the script. You can use either loadVars or loadVariables.

But if I were you, which I’m not, I’d do it with PHP. Lots of tutes out there, and very very easy. I think there’s a link in a very recent post.

pom :asian:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 15, 2002, 2:49pm UTC](https://forum.kirupa.com/t/sending-e-mail-through-a-form-created-in-flash/6739/3 "2002-10-15T14:49:10Z")

</div>

Here is a simple form structure using Flash and PHP,

on (release) {  
if (sender\_name eq “”) {  
gotoAndStop (58);  
} else if (sender\_email eq “”) {  
gotoAndStop (58);  
} else if (sender\_message eq “”) {  
gotoAndStop (58);  
} else {  
getURL (“send\_flash\_form.php”, “”, “POST”);  
}  
}  
// Checks to make sure the section is filled out and sends the variables you create to the php script

\<?

// Copyright by [filedesign.com](http://filedesign.com) 2001, 2002  
// Information: Do not change the name of this file, it’ ill not work !

// Configuration of recipient and subject.  
$recipient = "youremail@whatever.com";  
$subject = “Contact Form”;

// Please do not change anything below this line!!!  
// \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

```
   $mailheaders = "From: &lt;$sender_email&gt; 

```

";  
$mailheaders .= "Reply-To: \<$sender\_email\>

";

```
   $msg = " _____________________________________________________________________

```

";  
$msg .= "Sender’s Name: $sender\_name  
";  
$msg .= "  
";  
$msg .= "Sender’s E-Mail: $sender\_email  
";  
$msg .= "  
";  
$msg .= "Company: $sender\_company  
";  
$msg .= "  
";  
$msg .= "Website: $sender\_website  
";  
$msg .= "  
";  
$msg .= "Message:

$sender\_message  
";  
$msg .= "  
";  
$msg .= “\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_”;

```
   mail($recipient, $subject, $msg, $mailheaders) or die ("Couldn't send mail!");

```

?\>

Hope this helps!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 15, 2002, 3:28pm UTC](https://forum.kirupa.com/t/sending-e-mail-through-a-form-created-in-flash/6739/4 "2002-10-15T15:28:04Z")

</div>

Hey Allen,  
Maybe you should explain why you gotoAndStop(58) 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 15, 2002, 3:37pm UTC](https://forum.kirupa.com/t/sending-e-mail-through-a-form-created-in-flash/6739/5 "2002-10-15T15:37:43Z")

</div>

Hey Guys,

Thanks for the help. I really appreciate it. I’ve just never used PHP before. Anyone know where I could get a good Flash/PHP mail tutorial?

Thanks,

Kelly

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 15, 2002, 5:23pm UTC](https://forum.kirupa.com/t/sending-e-mail-through-a-form-created-in-flash/6739/6 "2002-10-15T17:23:32Z")

</div>

try [www.actionscript.org](http://www.actionscript.org) I found one there at it was really easy!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 15, 2002, 9:22pm UTC](https://forum.kirupa.com/t/sending-e-mail-through-a-form-created-in-flash/6739/7 "2002-10-15T21:22:40Z")

</div>

ilyaslamasse, sorry frame 58 was just a stop fram!  
Actually i have redone the whole code, and if anyone would like the source for this (the FLA, PHP, SWF) i would be more than happy to give it to you.

I just finished this question forum

[http://www.mxexhibits.com/](http://www.mxexhibits.com/)

Just click on the Customer Satisfaction Form to see the final product
