Solved

Contact - email submitter

Posted on 2003-12-06
15
257 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
  • 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
 
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
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…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

706 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now