# Email form without PHP

**URL:** https://forum.kirupa.com/t/email-form-without-php/64051
**Category:** flash
**Created:** [September 12, 2004, 9:51pm UTC](https://forum.kirupa.com/t/email-form-without-php/64051 "2004-09-12T21:51:16Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![ignusb](https://avatars.discourse-cdn.com/v4/letter/i/9f8e36/32.png) [@ignusb](https://forum.kirupa.com/u/ignusb)
#### Post date: [September 12, 2004, 9:51pm UTC](https://forum.kirupa.com/t/email-form-without-php/64051/1 "2004-09-12T21:51:16Z")

</div>

Is there a way of making an email form in flash WITHOUT the use of PHP, or even without the use of anything (except the .swf) serverside?

---

<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: [September 12, 2004, 11:50pm UTC](https://forum.kirupa.com/t/email-form-without-php/64051/2 "2004-09-12T23:50:12Z")

</div>

I take it you’re hosting with a free hosting company like Geocities or something that don’t support PHP!?

Simple answer is no. You need to use PHP or ASP or some other similar technology.

---

<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: [September 13, 2004, 4:50am UTC](https://forum.kirupa.com/t/email-form-without-php/64051/3 "2004-09-13T04:50:53Z")

</div>

So if I have a separate server which does support PHP or ASP, can I use that?

---

<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: [September 13, 2004, 7:24am UTC](https://forum.kirupa.com/t/email-form-without-php/64051/4 "2004-09-13T07:24:19Z")

</div>

yep:lol:

scotty(-:

---

<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: [September 13, 2004, 8:45am UTC](https://forum.kirupa.com/t/email-form-without-php/64051/5 "2004-09-13T08:45:56Z")

</div>

Yes. You can send eMails without using server side technology. see this link.  
[http://www.webthang.co.uk/tuts/tuts\_fmx/gfmx3/gfmx3\_1.asp](http://www.webthang.co.uk/tuts/tuts_fmx/gfmx3/gfmx3_1.asp)

---

<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: [September 13, 2004, 10:18pm UTC](https://forum.kirupa.com/t/email-form-without-php/64051/6 "2004-09-13T22:18:40Z")

</div>

> [@nishanthe](#):
>
> Yes. You can send eMails without using server side technology. see this link.  
> [http://www.webthang.co.uk/tuts/tuts\_fmx/gfmx3/gfmx3\_1.asp](http://www.webthang.co.uk/tuts/tuts_fmx/gfmx3/gfmx3_1.asp)

Sorry, that isn’t the kind of solution i’m looking for.  
This is for a childrens website, and I don’t know if they will have any mail programs set up.  
This is the site at the moment: [www.stickytv.co.nz It is a childrens website for a TV show on every weekday, and comparing it to this: [URL=http://www.squirt.tv]squirt.tv](http://www.stickytv.co.nz) which from what i can gather, was made by someone who uses [kirupa.com](http://kirupa.com), and it is wonderful, I would be ecstatic if I could make one ot this quality.  
Anyway, I am just a 15 year old, bored in the holidays, in NZ, and I decided it was pathetic, so i e-mailed the admin, and now I am redoing it.  
If you have a look at the source of their Contact Us! page, you will see it uses a .pl extension to send an email from the form. Is it possible to use this to send from flash?  
And Scotty, don’t laugh, i’m just a newbie at web design…

---

<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: [September 13, 2004, 11:38pm UTC](https://forum.kirupa.com/t/email-form-without-php/64051/7 "2004-09-13T23:38:29Z")

</div>

> If you have a look at the source of their Contact Us! page, you will see it uses a .pl extension to send an email from the form. Is it possible to use this to send from flash?

Yes you can interface flash with a PERL script, I have done it and it is quite easy. This is still a server side technology though using the CGI standard. Why do you not want to use a server side technology?

---

<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: [September 13, 2004, 11:57pm UTC](https://forum.kirupa.com/t/email-form-without-php/64051/8 "2004-09-13T23:57:11Z")

</div>

> [@aknatn](#):
>
> Why do you not want to use a server side technology?

Because I want a flash based email form

---

<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: [September 14, 2004, 12:51am UTC](https://forum.kirupa.com/t/email-form-without-php/64051/9 "2004-09-14T00:51:16Z")

</div>

> Because I want a flash based email form

Yeah I gathered that, but using flash with server side technology is how you make a flash based form.

---

<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: [September 14, 2004, 12:55am UTC](https://forum.kirupa.com/t/email-form-without-php/64051/10 "2004-09-14T00:55:38Z")

</div>

Oops, read your question wrong 🙂  
I want to do it without server side because the server I am using doesn’t support it.  
Can someone help me with using the .pl script on that server? I need to know how to integrate it with flash.

---

<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: [September 14, 2004, 2:14am UTC](https://forum.kirupa.com/t/email-form-without-php/64051/11 "2004-09-14T02:14:58Z")

</div>

Here is a PERL (.pl) script I have used in place of PHP, copy and paste it into a plain text file and save as mail.pl, upload it to the server into your cgi-bin directory and be sure it is CHMODed to 755:

```auto

#!/usr/bin/perl

require "subparseform.lib";
&Parse_Form;

$Email = $formdata{'Email'};
$FirstName = $formdata{'FirstName'};
$ToComments = $formdata{'ToComments'};

$ToEmail = "aknatn411\@comcast.net";
$ToSubject = "Response from Smorgy Porf";

$EmailBody = "Sent By: $FirstName
Senders Email: $Email

Message Sent:
$ToComments
";

$EmailFooter = "
This message was sent by: $FirstName. If you feel that you 
recieved this e-mail by accident please contact us at www.smorgyporf.com";

$Message = $EmailBody.$EmailFooter;

open (MAIL, "|/usr/sbin/sendmail -t") || &ErrorMessage;
print MAIL "To: $ToEmail 
From: $Email
";
print MAIL "Subject: $ToSubject
";
print MAIL "$Message
";
close (MAIL);

print "Content-type: text/html

";
print "_root.contact.contact_window.text.EmailStatus=Complete - Your communication has been sent";

sub ErrorMessage {
print "Content-type: text/html

";
print "_root.contact.contact_window.text.EmailStatus=Failed Please email info@smorgyporf.com";
exit; }

```

And here is the Action script, attach it to your submit button:

```auto

on (release) {
 if (!Email.length || Email.indexOf("@") == -1 || Email.indexOf(".") == -1) {
 EmailStatus = "Enter valid email";
 }
 else if (!FirstName.length) {
 EmailStatus = "Enter Name";
 }
 else if (!ToComments.length) {
 EmailStatus = "Please fill comments";
 }
 else {
 loadVariablesNum ("http://www.smorgyporf.com/cgi-bin/mail.pl", "0", "Post");
 EmailStatus = "Sending... Please be patient...";
 }
}

```

If you can’t figure out how to do the variables let me know and I’ll give you more instructions.

---

<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: [September 14, 2004, 4:54am UTC](https://forum.kirupa.com/t/email-form-without-php/64051/12 "2004-09-14T04:54:54Z")

</div>

Thanks for all that, but I can’t use that, the question with the .pl script was could I use the one which was already there and being used, nd from what I can work out, these are the needed variables:

[http://home.xtra.co.nz/cgi-bin/FormMail.pl](http://home.xtra.co.nz/cgi-bin/FormMail.pl)  
\<input type=hidden name=“recipient” value=“stickytv@pickledpossum.co.nz”\>  
\<input type=hidden name=“subject” value=“Sticky TV comments”\>  
\<input type=hidden name=“redirect” value=“[http://www.home.xtra.co.nz/hosts/stickytv/thanks-for-feedback.html](http://www.home.xtra.co.nz/hosts/stickytv/thanks-for-feedback.html)”\> \<input type=text name=“realname” size=30\>  
\<input type=text name=“email”\>  
\<textarea name=“comments”\>

That is not all the code there is, it’s just the bits I think are needed.

The user inputs would be, in their order, with examples:  
realname : bob the builder  
email : [bob@thebuilder.com](mailto:bob@thebuilder.com)  
comments : I can fix it!

---

<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: [September 14, 2004, 6:00am UTC](https://forum.kirupa.com/t/email-form-without-php/64051/13 "2004-09-14T06:00:35Z")

</div>

If you’re using formmail (great ol’ mailscript), you can easily set it up to recieve variables from Flash. It even has built-in support for GET/POST, so you need not worry about that! (though it wouldn’t hurt to pay a bit of attention to it…).

---

<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: [September 14, 2004, 8:55am UTC](https://forum.kirupa.com/t/email-form-without-php/64051/14 "2004-09-14T08:55:40Z")

</div>

Yes, it is FormMail, so could you please tell me how to code my file? Remember, I am a n00b at this sort of thing, maybe you could lead me to a tutorial?

---

<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: [September 14, 2004, 9:09am UTC](https://forum.kirupa.com/t/email-form-without-php/64051/15 "2004-09-14T09:09:01Z")

</div>

> [@ignusb](#):
>
> …And Scotty, don’t laugh, i’m just a newbie at web design…

I wasn’t making fun out of you, but laughing for my short answer…

scotty(-:

---

<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: [September 14, 2004, 3:31pm UTC](https://forum.kirupa.com/t/email-form-without-php/64051/16 "2004-09-14T15:31:07Z")

</div>

Ok, you’re confusing me big time here. You want to Mod formMail to use it with flash. You did not post any valuable part of the script, just the html side of the form, which is what you need to make in flash. The script itself is what you need to mod. That’s no sweat either, but really you will just end up with a more complicated version of the script I gave you. You have PERL abilitiy since you’re using formMail there, why not upload the easy one I sent you?

---

<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: [September 14, 2004, 9:45pm UTC](https://forum.kirupa.com/t/email-form-without-php/64051/17 "2004-09-14T21:45:34Z")

</div>

> [@aknatn](#):
>
> Why not upload the easy one I sent you?

1. The FormMail script is on the ISP’s server, but I figured the html thing may help as to what variables are needed.
2. The account on the server I have access to does not support perl, PHP, or most other scripts.

---

<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: [September 14, 2004, 10:39pm UTC](https://forum.kirupa.com/t/email-form-without-php/64051/18 "2004-09-14T22:39:20Z")

</div>

I see, so your isp let’s you send email via THEIR formMail script as a remotely hosted cgi script.

Bottom line, you need to be able to modify the formMail script, which you do not have access to, so you can not modify.

---

<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: [September 14, 2004, 11:06pm UTC](https://forum.kirupa.com/t/email-form-without-php/64051/19 "2004-09-14T23:06:36Z")

</div>

So even if I get a copy of the script, I still have to edit it to make it compatible with flash?

---

<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: [September 15, 2004, 1:23am UTC](https://forum.kirupa.com/t/email-form-without-php/64051/20 "2004-09-15T01:23:04Z")

</div>

like I said before

> [@aknatn](#):
>
> That’s no sweat either, but really you will just end up with a more complicated version of the script I gave you. You have PERL abilitiy since you’re using formMail there, why not upload the easy one I sent you?

I don’t know of any other way, at least not and provide any feedback. You could theoretically be submitting the same variables via flash through the getURL method, but I don’t know for sure because the script does not reside locally on your server, so you got me there. Have you ried setting up the form in flash the same way you would setup the form in html and just submitting it tothe script? You have to test it after uploading it to your server for sure, I am pretty sure it would not work locally. Try that and see what happens.

[Next page](https://forum.kirupa.com/t/email-form-without-php/64051.md?page=2)
