?
Solved

Contact - email submitter

Posted on 2003-12-06
15
Medium Priority
?
266 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
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!

 
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 150 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
Suggested Courses

752 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