Solved

Contact - email submitter

Posted on 2003-12-06
15
262 Views
Last Modified: 2010-04-03
I have four main fields i need to submit to email.

name (text)
email (email)
message (main body)
message subject (this is selectable from radio buttons)

how do i submit all this lot to an email address?


0
Comment
Question by:volatile
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 6
15 Comments
 
LVL 9

Expert Comment

by:OBCT
ID: 9890510
For this you will need to use a server side script. The one I use is php.
Give all your fields var names like....name, email, message, subject.
Now you can add this code onto your send button:

on(release) {
     myEmail = new LoadVars();
     myEmail.name = name.text;
     myEmail.email = email.text;
     myEmail.subject = subject.text;
     myEmail.message = message.text;
     myEmail.load("http://www.yourwebsite.com/yourfolder/mail.php", myEmail, "POST");
     myEmail.onLoad = function (success) {
          if (success) {
               mytextbox = "The email has been sent";
          } else {
               mytextbox = "An error has occured";
          }
     }
}

Now for your php script:

<?PHP
$name = $_POST['name'];
$email = $_POST['email'];
$subject = $_POST['subject'];
$message = $_POST['message'];

mail($email, $subject, $message, $name);
?>

Make sure you name that file "mail.php"
If this doesn't work then have a look at this tutorial.
http://www.actionscript.org/tutorials/intermediate/php_send_mail/index.shtml

Cheers

-OBCT
0
 
LVL 9

Expert Comment

by:OBCT
ID: 9975848
volatile,

How is your project going? Is there anything else I can help you with?

Cheers

-OBCT
0
 

Author Comment

by:volatile
ID: 9975865
still strugling with it.  im trying your code and variations of it.

I also need to very similar email submitters too and cant get any of them to work.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 9

Expert Comment

by:OBCT
ID: 9975876
The first thing to check is if your webserver supports php. If not, the scripts wont work. Also php must be on a webserver before it can run.
If that doesn't fix anything, show me the code your using and we'll fix it up.

Cheers

-OBCT
0
 

Author Comment

by:volatile
ID: 9975900
this is one problem.  ive tried on servers that support php and asp

i find the asp easier to understand, but still no joy.  ill work on it over the weekend and see what comes up.  thanks man.
0
 

Author Comment

by:volatile
ID: 9989174
nah, its no good.  i need an ASP one for the above fields.  can u help man?
0
 
LVL 9

Accepted Solution

by:
OBCT earned 50 total points
ID: 9989232
Using the load vars function I showed you will work if your using asp, php etc. I don't know any asp so you'll have to post a question in the asp section:
http://www.experts-exchange.com/Web/Web_Languages/ASP/

on(release)
{
     myEmail = new LoadVars();
     myEmail.name = name.text;   //name is the name of the "name" variable in your asp page. The name.text is the var name of your input box in flash
     myEmail.email = email.text;
     myEmail.subject = subject.text;
     myEmail.message = message.text;
     myEmail.onLoad = function (success)
     {
          if (success)
          {
               mytextbox = "The email has been sent";    //mytextbox is the instance name of the dynamic text box that you want to show the status with
          }
          else
          {
               mytextbox = "An error has occured";
          }
     };
     myEmail.load("http://www.yourwebsite.com/yourfolder/mail.asp", myEmail, "POST");
}

Sorry I couldn't help you with the asp scripting.
Good luck.

Cheers

-OBCT
0
 

Author Comment

by:volatile
ID: 10234442


ok the answer didn't solve the question, but gave me a better understanding of the script.  My problem remains unresolved.  Should I have posted an A based on effort?  This place confuses me.
0
 
LVL 9

Expert Comment

by:OBCT
ID: 10234508
B: The Expert(s) provided an acceptable solution, or a link to an acceptable solution, that you were able to use, although you may have needed a bit more information to complete the task.

Your question was-

name (text)
email (email)
message (main body)
message subject (this is selectable from radio buttons)

how do i submit all this lot to an email address?


I gave the standard way to do this task using Macromedia Flash and PHP.
Here is the place to go if requiring assistance with ASP-
http://www.experts-exchange.com/Web/Web_Languages/ASP/
0
 

Author Comment

by:volatile
ID: 10234538
listen man.  I am just trying to be honest here.  I thought that was the whole point of this site.  I am giving my absolute honest opinion.  I can't believe the grief I'm getting for giving someone a grade that I thought was suitable.  What the guidelines should say is "Give everyone an A regardless".   I am really really not bothered.  Get the modifier to change it, fine, great.  This is just taking up my time now.
0
 
LVL 9

Expert Comment

by:OBCT
ID: 10234550
I appologize for causing you "grief", it was never intended. For the record, I asked for the grade to be reviewed, not changed to an A.
0
 

Author Comment

by:volatile
ID: 10248257
OBCT. I wasn't just referring to this question.  I've had a lot of feedback about my grades etc etc. My understanding of the grade system was not inline with the experts on this site, and led to some confusion.  I've had to post countless messages which have nothing to do with IT, or my problems or anything contructive at all.  This is why I was a bit fed up in the message above.  If the moderator is ready, please change the grade.

V
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question