Send Mail via php using Flash 8

  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23455
  • Loc: Woodbridge VA

Post 3+ Months Ago

getting a 404 bryce
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

Try now there was a typo. Sorry.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23455
  • Loc: Woodbridge VA

Post 3+ Months Ago

OK got it that time. Thanks
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23455
  • Loc: Woodbridge VA

Post 3+ Months Ago

I did find and corrected several issues but had too much going on at work to solve everything before I left. I'll do my best to post it early in the AM.
  • gmoeller54
  • Newbie
  • Newbie
  • gmoeller54
  • Posts: 10

Post 3+ Months Ago

thanks for supplying the CS3 version!
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23455
  • Loc: Woodbridge VA

Post 3+ Months Ago

I still haven't been able to give your file a lot of attention but I can give you some things to get you closer to a working form.

First I'm really not sure why you have the code you do for the reset button. You have:

ACTIONSCRIPT Code: [ Select ]
on (release) {
     getURL("contact.php", "_blank", "GET");
     name = "Your Name:";
     phone = "Your Phone:";
     company = "Your Company:";
     email = "Your Email:";
     message = "Message:";
}
  1. on (release) {
  2.      getURL("contact.php", "_blank", "GET");
  3.      name = "Your Name:";
  4.      phone = "Your Phone:";
  5.      company = "Your Company:";
  6.      email = "Your Email:";
  7.      message = "Message:";
  8. }


First of all you don't have a file contact.php. Even if you do, it isn't going to accomplish what you want with the reset button. To reset you simply want to make your text field variables blank. This is sufficient to do that:

ACTIONSCRIPT Code: [ Select ]
on (release){
     name = "";
     phone = "";
     company = "";
     email = "";
     message = "";
}
  1. on (release){
  2.      name = "";
  3.      phone = "";
  4.      company = "";
  5.      email = "";
  6.      message = "";
  7. }


For your text fields one thing I would suggest is change your fields from multi-line to single-line except for the Message field. I would also suggest putting in some character limits. Your maximum characters are all set to 0. I would change them to approx 30 except for message which I would say around 500 would be fine.

For your submit button you don't really need this
ACTIONSCRIPT Code: [ Select ]
var name = this._parent.name.text
var company = this._parent.company.text
var phone = this._parent.phone.text
var email = this._parent.email.text
var message = this._parent.message.text
  1. var name = this._parent.name.text
  2. var company = this._parent.company.text
  3. var phone = this._parent.phone.text
  4. var email = this._parent.email.text
  5. var message = this._parent.message.text


also for error.gotoAndPlay("error"); and error.gotoAndPlay("send"); lose "error." Just use the gotoAndPlay. In prior posts above "error" is the instance of a movieclip I loaded. You don't have an error movieclip.

After those changes your errors start to display but there is still a problem. If you leave all your fields blank and click submit it should take you to the error clip but it doesn't it takes you to sent. If you add a trace on your variables you'll see that initially it's adding some HTML <p> tags to your text fields and I'm not sure why. Unfortunately I've been too busy to give it any kind of time to trouble shoot. That's as far as I got and won't have any time to look at it again until perhaps this weekend. But that should give you some things to go with.

Also check your Actions on your error and sent tweens. I'm think some of your gotoAndPlay's are set to the wrong frames. In particular the close button.

I'd also suggest moving your error tweens farther on the timeline to where your text fields are hidden. It looks rather amateurish to display the errors over the text fields.

I know that's not a lot but hope it helps you narrow things down.
  • gmoeller54
  • Newbie
  • Newbie
  • gmoeller54
  • Posts: 10

Post 3+ Months Ago

I have gone through all of your suggestions, and it looks as though I have arrived exactly where you left off.

For whatever reason, if you were to leave the fields blank and only hit submit, it doesn't send it to the error frame, but rather to the sent frame.

ACTIONSCRIPT Code: [ Select ]
     if (name eq "" or phone eq "" or email eq "" or message eq "") {
         gotoAndPlay(3);
     } else {
         loadVariablesNum("vmail.php", 0, "POST");
  1.      if (name eq "" or phone eq "" or email eq "" or message eq "") {
  2.          gotoAndPlay(3);
  3.      } else {
  4.          loadVariablesNum("vmail.php", 0, "POST");


This is the code being used to check for empty fields
seems to be skipping right over this...is the syntax correct?

Also, it's not sending to my email anything at all.

I have loaded up the new version, with corrected frame calls.
I also edited the .php because I found a couple more span tags.
soldesigns(dot)com/silicone/gmoeller_contact_form_2_8_10.zip

Would love to get this guy working!
  • gmoeller54
  • Newbie
  • Newbie
  • gmoeller54
  • Posts: 10

Post 3+ Months Ago

Please guys...I would really like to resolve this form...I'll be happy to give a donation if that's what it's going to take...seriously
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23455
  • Loc: Woodbridge VA

Post 3+ Months Ago

I hadn't had the chance to look at what you revised. But that was sort of what I was saying. It isn't skipping over it per se. For some reason when the flash loads, it loads some HTML into those fields (Which you can see if you trace your variables like I suggested). Then after you hit submit or reset the fields are empty. I'll try to look at it again later today, but really going to be pretty busy all weekend. OK actually I'm taking my girlfriend to a casino and Flash is probably going to be the last thing on my mind.


I can't remember exactly what the HTML is but I do remember it was a <p> tag with a text-align attribute. That's where I would troubleshoot. Why that is being added.
  • gmoeller54
  • Newbie
  • Newbie
  • gmoeller54
  • Posts: 10

Post 3+ Months Ago

ha...
i completely understand...
have fun with the girly...

not too sure how to "trace" variables...
but will try to google it...

thanx!
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23455
  • Loc: Woodbridge VA

Post 3+ Months Ago

Trace is simple

trace(name);
trace(message);
etc...

Then when you test your movie it will output the variable contents. If you see nothing they are empty.
In your case something is setting the initial value of the variables to some HTML code and I didn't have time to dig into what was doing it.
  • gmoeller54
  • Newbie
  • Newbie
  • gmoeller54
  • Posts: 10

Post 3+ Months Ago

I'm sorry for being such a pest, but I am having no luck trying to track down what is going on. Could you please look at my file when you have a moment? Thanx!!
  • palmershire
  • Born
  • Born
  • palmershire
  • Posts: 2

Post 3+ Months Ago

When sending my form, using this code:

on (release) {
getURL("mailto:(email)" + "?subject=" +subject+ "&body=" +body);
}


both the subject field and message body show up as:

<p align="left"></p>

or some other odd text when viewed from my email account.

*I've checked both the form fields and neither show the <> mentioned earlier in this forum. I could really use some help resolving this issue. Thanks!

**Since we're not allowed to post external links within the forum, I had to substitute (email) for the text that actually exists in the get URL section following the mailto: function.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23455
  • Loc: Woodbridge VA

Post 3+ Months Ago

That's the same thing that gmoeller54 had showing up in his. That's not supposed to exist if you have HTML turned off in the text fields.

In his case it was disabled and still that was happening and I have no clue why. In your case, check your text fields and make sure you don't have HTML turned on.
  • palmershire
  • Born
  • Born
  • palmershire
  • Posts: 2

Post 3+ Months Ago

After checking the HTML settings, what I found is that if I changed Flash 8 to Flash 7 with AS 2.0 as the settings, the email was able to send correctly.

Issue Resolved. :iconthumbright:

Thanks for your time.
  • zicmu
  • Newbie
  • Newbie
  • zicmu
  • Posts: 7

Post 3+ Months Ago

ATNO/TW . . . Greetings ! I've been reading all your post . And I think sending an email directly with flash is very good than sending through Microsoft Outlook. It saves time. I've been trying to make your code work. But it seems that it don't even send anything to my email. I want to make some contact form in my sites. I'm using swishmax 2. and i've been uploading your files with the same sites. But yet still the same output. I would like to ask for some tutorials on how to make a flash email sender works and where/how to upload. Sorry for me being noob. Anything from you will really be a good help for a newbie like me. THANKS IN ADVANCE SIR!
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23455
  • Loc: Woodbridge VA

Post 3+ Months Ago

There are a variety of ways to do it. Try this google search There are a lot of good links there that can help you.
  • zicmu
  • Newbie
  • Newbie
  • zicmu
  • Posts: 7

Post 3+ Months Ago

Thanks Atno! I've already tried several ways of doing a EMAIL in FLASH FORM ... but i've always end up in the same place. Nothing happend with my flash form. and my emails didnt receive any emails from my site... Is it the site where i've upload my Files? If its ok if you can give me instructions and where can i upload my files. I REALLY APPRECIATED YOUR HELP! THANKS IN ADVANCE!
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23455
  • Loc: Woodbridge VA

Post 3+ Months Ago

It could be the server. Do they support php mail? If not, it won't work using php. If so you might want to post your action script and your php script for us to look at for errors.
  • zicmu
  • Newbie
  • Newbie
  • zicmu
  • Posts: 7

Post 3+ Months Ago

//>This What i have in my Send Button <//
on (release) {
if ((nameVar=="")||(emailVar=="")) {
errormessage="Please fill name and email fields";
} else {
errormessage="Sending....";
send="yes";
this.loadVariables("contact.php",'POST');
nameVar="";
emailVar="";
subjectVar="";
msgVar="";
}
}

//>And this is what i have inside my contact.php file <//
<?
if ($send=="yes") {
$sendTo = "myemail"; //>as for my email<//
if ($subjectVar=="") { $subject="Contact from Website"; } else { $subject="$subjectVar"; }
$body = "$msgVar";
$headers = "From: " . $nameVar;
$headers .= "<" . $emailVar . ">\r\n";
$headers .= "Reply-To: " . $emailVar;
mail($sendTo, $subject, $body, $headers);
}
echo "&errormessage=Email has been sent&";
?>

I've uploaded my files in freewebs. If you have other free website aside in what i've said please let me know. ^^,

That's all i have in my email form. Thanks for the help Sir ATNO. I'm still hoping that I can send this email to my mail.
>>>by the way I'm using SwishMax 2 as my Flash Creator.
Many Thanks Sir ATNO . . . More Power to you and this Site!
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23455
  • Loc: Woodbridge VA

Post 3+ Months Ago

As best I can tell from this page if you are using the free service there, then programming languages are not supported. That would be at least one reason why your mail isn't working.

I don't use free hosting services so I have none to recommend.
  • zicmu
  • Newbie
  • Newbie
  • zicmu
  • Posts: 7

Post 3+ Months Ago

How bout the codes? Is that right? Paying sites is no big deal. Just wondering if this will work. Thanks Sir ATNO!
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23455
  • Loc: Woodbridge VA

Post 3+ Months Ago

The code looks OK to me. I didn't see anything that jumped out as being wrong. But whatever you get for a host has to support php and php mail for it to work.

Even with freewebs premium services there doesn't seem to be a clear indication if php and php mail is supported, so if that's what you're considering check with their support first.
  • zicmu
  • Newbie
  • Newbie
  • zicmu
  • Posts: 7

Post 3+ Months Ago

Sir ATNO . . . Do you have any recommended PHP and PHP Mail Supported Hosting sites?. I'm really not familiar with any of the hosting sites. If you have one, please let me know. I'll try it too! Thanks SIR ATNO!
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23455
  • Loc: Woodbridge VA

Post 3+ Months Ago

Sorry it took so long to see your question. I've been away from OZZU for a few days.

I can only recommend one, and it's the one I use. The owner of OZZU, Bigwebmaster has hosting available. Read this link for more information

I would suggest sending him a PM or contacting him through the contact form.
contact.php
  • zicmu
  • Newbie
  • Newbie
  • zicmu
  • Posts: 7

Post 3+ Months Ago

SIR ATNO . . . I WANT TO APPLY WITH THIS OZZU WEBHOSTING. BUT I DONT KNOW WHERE . AND SIR ATNO . . . IF IT'S OK . . . BEFORE I'D APPLIED TO OZZU. I WANT TO KNOW HOW CAN I ACTIVATE THE EMAIL SENDING. WHERE WOULD I UPLOAD THE PHP FILES. JUST LITTLE HINTS TO GET ME STARTED. BECAUSE WHAT IF IVE APPLIED AND STILL I DONT KNOW. MAYBE THIS SITE WONT HELP ME AT ALL. THANKS SIR ATNO! MORE POWER!
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23455
  • Loc: Woodbridge VA

Post 3+ Months Ago

As far as applying for hosting, you do what I said in my last post and contact Bigwebmaster, either by sending him a private message or using the contact link.
ATNO/TW wrote:
The owner of OZZU, Bigwebmaster has hosting available. Read this link for more information

I would suggest sending him a PM or contacting him through the contact form.
contact.php


As far as uploading files, you would upload the php file into the same directory as your flash file, which in most cases I would assume to be the root.

You don't have to do anything to turn on PHP mail. It's part of the service. The script in the php file that you already have should work.
  • zicmu
  • Newbie
  • Newbie
  • zicmu
  • Posts: 7

Post 3+ Months Ago

Thanks Sir ATNO. I've already contacted Bigwebmaster. Thanks a lot Sir! You have been a really big help to me. Thanks again!
  • pansylea
  • Born
  • Born
  • pansylea
  • Posts: 1

Post 3+ Months Ago

Sorry for resurrecting an old thread but can't get my flash/php contact form working.

Action Script:
Code: [ Select ]
var checkFormAndSend = function () {
    clearInterval(__root.intervalResponse);
    __root.contact_clip.response_label._alpha = 0;
    if ((((__root.contact_clip.contact_form.input0.text != __root.formLabels[0]) && (__root.contact_clip.contact_form.input1.text != __root.formLabels[1])) && (validateEmail(__root.contact_clip.contact_form.input1.text))) && (__root.contact_clip.contact_form.input2.text != __root.formLabels[2])) {
      var _local1 = 0;
      while (_local1 < __root.formLabels.length) {
        __root.contact_clip.contact_form["input" + _local1].text = __root.formLabels[_local1];
        _local1++;
      }
      __root.showResponse("THANKS");
      return(undefined);
      var mailVars = new LoadVars();
      mailVars.fullname = __root.contact_clip.contact_form.input0.text;
      mailVars.email = __root.contact_clip.contact_form.input1.text;
      mailVars.body = __root.contact_clip.contact_form.input2.text;
      mailVars.form_admin_email = __root.contactAdminEmail;
      mailVars.onLoad = function (success) {
        if (success) {
          if (mailVars.operationResult == "OK") {
            var _local1 = 0;
            while (_local1 < __root.formLabels.length) {
              __root.contact_clip.contact_form["input" + _local1].text = __root.formLabels[_local1];
              _local1++;
            }
            __root.showResponse("THANKS");
          } else {
            __root.showResponse("SORRY ... TRY AGAIN");
          }
        } else {
          __root.showResponse("SORRY ... TRY AGAIN");
        }
      };
      mailVars.sendAndLoad("sendMail.php", mailVars, "POST");
  1. var checkFormAndSend = function () {
  2.     clearInterval(__root.intervalResponse);
  3.     __root.contact_clip.response_label._alpha = 0;
  4.     if ((((__root.contact_clip.contact_form.input0.text != __root.formLabels[0]) && (__root.contact_clip.contact_form.input1.text != __root.formLabels[1])) && (validateEmail(__root.contact_clip.contact_form.input1.text))) && (__root.contact_clip.contact_form.input2.text != __root.formLabels[2])) {
  5.       var _local1 = 0;
  6.       while (_local1 < __root.formLabels.length) {
  7.         __root.contact_clip.contact_form["input" + _local1].text = __root.formLabels[_local1];
  8.         _local1++;
  9.       }
  10.       __root.showResponse("THANKS");
  11.       return(undefined);
  12.       var mailVars = new LoadVars();
  13.       mailVars.fullname = __root.contact_clip.contact_form.input0.text;
  14.       mailVars.email = __root.contact_clip.contact_form.input1.text;
  15.       mailVars.body = __root.contact_clip.contact_form.input2.text;
  16.       mailVars.form_admin_email = __root.contactAdminEmail;
  17.       mailVars.onLoad = function (success) {
  18.         if (success) {
  19.           if (mailVars.operationResult == "OK") {
  20.             var _local1 = 0;
  21.             while (_local1 < __root.formLabels.length) {
  22.               __root.contact_clip.contact_form["input" + _local1].text = __root.formLabels[_local1];
  23.               _local1++;
  24.             }
  25.             __root.showResponse("THANKS");
  26.           } else {
  27.             __root.showResponse("SORRY ... TRY AGAIN");
  28.           }
  29.         } else {
  30.           __root.showResponse("SORRY ... TRY AGAIN");
  31.         }
  32.       };
  33.       mailVars.sendAndLoad("sendMail.php", mailVars, "POST");


PHP code:
Code: [ Select ]
<?
$fullname = $_POST['fullname'];
$email = $_POST['email'];
$body = $_POST['body'];

// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\n";
// Additional headers
$headers .= 'To: <myemailaddress>' . "\n";
$headers .= 'From: <senderemailaddress>' . "\n";

$recipient = "myemailaddress";
$subject = "Contact Form Query";

$msg = $fullname . $email . $body;

mail($recipient, $subject ,$msg, $headers);

?>
  1. <?
  2. $fullname = $_POST['fullname'];
  3. $email = $_POST['email'];
  4. $body = $_POST['body'];
  5. // To send HTML mail, the Content-type header must be set
  6. $headers = 'MIME-Version: 1.0' . "\n";
  7. $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\n";
  8. // Additional headers
  9. $headers .= 'To: <myemailaddress>' . "\n";
  10. $headers .= 'From: <senderemailaddress>' . "\n";
  11. $recipient = "myemailaddress";
  12. $subject = "Contact Form Query";
  13. $msg = $fullname . $email . $body;
  14. mail($recipient, $subject ,$msg, $headers);
  15. ?>


When i try and send an email from the contact form it will not email anything, but if i type in the url to the sendMail.php, i get the email but without the entered information (obviously cause i haven't entered them).

Any advice would be a great help. Am at a standstill.

Thank you

Post Information

  • Total Posts in this topic: 59 posts
  • Users browsing this forum: No registered users and 15 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.