Solved

Contact - email submitter

Posted on 2003-12-06
15
258 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Failed download 57 551
YouTube video issue 28 110
camtasia alternative that can record 3 hours video plus audio 24 105
Some You tube not working in IE11 on Windows 10 and 8.1 5 58
This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
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 what frame rate is, how to control it and what effect it has on the video.

895 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

13 Experts available now in Live!

Get 1:1 Help Now