Ultrashock Forums > Flash > Data Communication
PRoblem sending email with flash

You are currently viewing our website as a guest which gives you limited access to forums, files and other resources.

Click here to join now for free, and start interacting with our members, download files and much more!

Click here if you are looking for our Flash files and other professional assets.
 
Post Reply | View first unread | Rate Thread Search this Thread | Thread Tools | Display Modes

#1
Bookmark and Share!
PRoblem sending email with flash
Old 2004-06-19

I am having problems to send an email from flash.I have another script that works just fine but I cant get this one to work and it pretty the same code.

I have this code in flash:
ActionScript Code:
  1. on(release) {
  2.     if( yourname.text == "" or youremail.text == "" or friendname.text == "" or friendemail.text == "") {
  3.         status = "Enter some text in the text fileds.";
  4.         Selection.setFocus("yourname");
  5.     }else {
  6.         ind = new LoadVars();
  7.         ind.yourname = yourname.text;
  8.         ind.youremail = youremail.text;
  9.         ind.friendname = friendname.text;
  10.         ind.friendemail = friendemail.text;
  11.         ind.sendAndLoad("flashindique.cfm",ind,'POST');
  12.         gotoAndStop(27);
  13.     }
  14. }

And here is my ColdFusion code:

ActionScript Code:
  1. <html>
  2. <head>
  3. </head>
  4. <body>
  5. <cfmail from="#trim(youremail)#" to="#trim(friendemail)#" subject= "#yourname#,wants to invite you to visit this Web Site!"
  6.  server="myserver"
  7.  port="25" type="html">
  8. <font size="2" face="Trebuchet MS">
  9.  Hi #friendname# !<br>
  10.  <br>
  11.  #yourname# has visited Tavares Web Site and He/She thought it is a very good web site.He/She decided to invite you to visit it.<br>
  12.  Tavares Web Site is about a story of a DJ named by his friends DJ Chambinho.<br>
  13.  You will get some information about him and how he started djing.It is a pretty web site with lots of good stuffs.<BR>
  14.  Pay a visit to our web site and we hope you enjoy it!<BR>
  15.  <br>
  16.  Thank you for your attention.<br>
  17.  <b>Eduardo Tavares (Dj Chambinho)</b><br>
  18.  <b><i><a href="http://www.eduardotavares.com.br">[url]www.EduardoTavares.com.br[/url]</a></i></b>
  19. </font>
  20. </cfmail>
  21. </html></body>

I tested with a static cfm file and it worked just fine but with flash is hard.

thx
Thank You!
E d u a r d o T a v a r e s
-------------------------------------
Delphi Developer - Web Designer
MSN:ecptj@hotmail.com
www.EduardoTavares.com.br
"I would like to die like my grandfather,sleeping,relaxing but not screaming desperately like the 40 passengers of the bus he was driving"
postbit arrow 2 comments | 163 views postbit arrow Reply: with Quote   
Registered User
ectavares is offline
seperator
Posts: 128
2003-12-04
seperator

Ultrashock Member Comments:
rtimoshenk rtimoshenk is offline rtimoshenk lives in United States 2004-06-19 #2 Old  
You know, I'm not much of a Cold Fusion user, but I do use PHP. I once created a mailing list, and the script looked like this:

ActionScript Code:
  1. on (release) {
  2.     if (_root.mcMainBoxMailingList.name eq "") {
  3.         _root.mcMainBoxMailingList.Status.text = "ERROR:  Name is a required field.";
  4.     } else if (_root.mcMainBoxMailingList.address eq "") {
  5.         _root.mcMainBoxMailingList.Status.text = "ERROR:  Address is a required field.";
  6.     } else if (_root.mcMainBoxMailingList.citystate eq "") {
  7.         _root.mcMainBoxMailingList.Status.text = "ERROR:  City and State/Province are required.";
  8.     } else if (_root.mcMainBoxMailingList.postalcode eq "") {
  9.         _root.mcMainBoxMailingList.Status.text = "ERROR:  Zip/Postal code required.";
  10.     } else if (!_root.mcMainBoxMailingList.email.length || _root.mcMainBoxMailingList.email.indexOf("@") == -1 || _root.mcMainBoxMailingList.email.indexOf(".") == -1) {
  11.         _root.mcMainBoxMailingList.Status.text = "ERROR:  Please enter a valid email address.";
  12.     } else {
  13.         Submit = "Yes";
  14.         _root.mcMainBoxMailingList.Status.text = "You have been added to the mailing list.";
  15.         loadVariablesNum ("list.php",0,"POST");
  16.     }
  17. }



It works just fine, and my PHP file just sends the email. Hope that helps in some way...
Reply With Quote  
PEDALSPEED PEDALSPEED is offline PEDALSPEED lives in United States 2004-06-25 #3 Old  
It's a cut and paste...so shoot me...

You need to specify a reply handler.
Verify what you are sending using toString().
But it's really your sendAndLoad line formatting that is making things difficult.



ActionScript Code:
  1. email = function () {
  2.     notes.length = 0;
  3.     vEmailToMemberPopUp ();
  4.     if (notes.push > 0) {
  5.         getPop_Up ();
  6.     } else {
  7.         var email_send:LoadVars = new LoadVars ();
  8.         var email_reply:LoadVars = new LoadVars ();
  9.         email_send.uName = uName.text;
  10.         //
  11.         email_reply.onLoad = function () {
  12.             if (email_reply.emailSent == 0) {
  13.                 notes.push ("Your email could not be sent. Contact the site Admin.");
  14.                 getPop_Up ();
  15.                 break;
  16.             } else {
  17.                 if (email_reply.emailSent == 1) {
  18.                     notes.push ("Your email has been sent to the member");
  19.                     getPop_Up ();
  20.                 }
  21.             }
  22.         };
  23.         email_send.sendAndLoad ("/inc/cf/cfmEmail.cfm?cacheKiller=" + new Date ().getTime (), email_reply, "POST");
  24.         // /test here......
  25.         // email_send.send ("/inc/cf/cfm_email.cfm?cacheKiller=" + new Date ().getTime (), "_blank", "POST");
  26.         _root.createTextField ("myTextField", _global.depth++, 222, 222, 222, 222);
  27.         myTextField.text = email_send.toString ();
  28.     }
  29. };
Reply With Quote  
Thread Tools
Display Modes Rate This Thread
Rate This Thread: