A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: How do I host and send e-cards?

Threaded View

  1. #1
    Member
    Join Date
    Jun 2006
    Posts
    55

    How do I host and send e-cards?

    I came across this little tutorial -> http://www.flash-db.com/Ecards/ there is a download too with the source files.

    Tried it out and it didn't work. It uses 2 PHP scripts to write files in a text folder on the server, and then send out the emails.

    I'm 100% sure I did everything right, however I'm NOT so sure this code is valid anymore. (maybe it's not allowed anymore)

    It confirms that it does send completely, but nothing comes in the mail.

    in any case, is there a better and confirmed working tutorial out there for e-card hosting and sending?


    What do you think? Here's the PHP that sends out the email

    PHP Code:
    <?

    $CreateEcard = date(U);

    $filename = $CreateEcard.".txt";

    $ToName = stripslashes($ToName);
    $FromName = stripslashes($FromName);
    $Greeting = stripslashes($Greeting);
    $IntroMessage = stripslashes($IntroMessage);
    $EndMessage = stripslashes($EndMessage);

    $Today = (date ("l dS of F Y ( h:i:s A )",time()));

    $Created="Ecard Created on $Today";

    $EcardNum = $EcardSelect;

    $EcardText = "ToName=$ToName&ToEmail=$ToEmail&FromName=$FromName&FromEmail=$FromEmail&Greeting=$Greeting&IntroMessage=$IntroMessage&Created=$Created";


    $fp = fopen( "./dBText/$filename","w"); 
    fwrite($fp, $EcardText, 10000); 
    fclose( $fp ); 

    ######Email Card########
    ## You can change the subject and the message part around.
    ## Make sure to change the Link as stated in the Tutorial.
    ## (Change from 'someSite' to your actual site - leave the rest the same


    $ToSubject = "You have recieved a Flash Ecard from $FromName";
    $Message = "$ToName,\nYou have recieved a Flash card from $FromName. \nClick the following link to view your card:\n\n http://www.belitawilliamart.com/Ecards/SelectCard.php?EcardText=$CreateEcard&ENum=$EcardNum\n\n-----------------------------------\nHere is the message that was sent:\n$ToName,\n$Greeting\n$IntroMessage\n\n-$FromName\n\n\n-----------------------------------\nThis card was sent from www.flash-db.com/Ecards/\n\nThe Flash-dB Team.";


    ###################
    ## This line actually sends the email - you should not have to change this.

    mail($ToName." <".$ToEmail.">",$ToSubject, $Message, "From: ".$FromName." <".$FromEmail.">");


    ## This next line returns a success message to the movie.
    print "_root.Status=Success your Card Has Been Sent!";

    #### End #########
    ## By: Jeffrey F. Hill
    ## www.flash-db.com

    ?>
    here's the display php

    PHP Code:
    <?

    switch ($ENum) {

        case '1':
        $goto = "Ecard1.swf?EcardText=".$EcardText;
        $gotoFooter = "EcardFooter.swf?EcardText=".$EcardText."&EcardSelect=1";
        $Dimensions = "WIDTH=700 HEIGHT=525";
        $DimensionsFooter = "WIDTH=700 HEIGHT=250";
        break;

        case '2':
        $goto = "Ecard2.swf?EcardText=".$EcardText;
        $gotoFooter = "EcardFooter.swf?EcardText=".$EcardText."&EcardSelect=2";
        $Dimensions = "WIDTH=700 HEIGHT=525";
        $DimensionsFooter = "WIDTH=700 HEIGHT=250";
        break;

        case '3':
        $goto = "Ecard3.swf?EcardText=".$EcardText;
        $gotoFooter = "EcardFooter.swf?EcardText=".$EcardText."&EcardSelect=3";
        $Dimensions = "WIDTH=700 HEIGHT=525";
        $DimensionsFooter = "WIDTH=700 HEIGHT=250";
        break;

        case '4':
        $goto = "Ecard4.swf?EcardText=".$EcardText;
        $gotoFooter = "EcardFooter.swf?EcardText=".$EcardText."&EcardSelect=4";
        $Dimensions = "WIDTH=700 HEIGHT=525";
        $DimensionsFooter = "WIDTH=700 HEIGHT=250";
        break;

        case '5':
        $goto = "Ecard5.swf?EcardText=".$EcardText;
        $gotoFooter = "EcardFooter.swf?EcardText=".$EcardText."&EcardSelect=5";
        $Dimensions = "WIDTH=700 HEIGHT=525";
        $DimensionsFooter = "WIDTH=700 HEIGHT=250";
        break;
    }

    ?>
    here's the action script that is in the send button

    Code:
    on (release) {
    	if (ToName eq "") {
    		_root.Status = "Please enter the Name of the person your sending this to";
    	} else if (FromName eq "") {
    		_root.Status = "Please enter your Name";
    	} else if (ToEmail eq "") {
    		_root.Status = "Please enter the Email address your sending this to";
    	} else if (FromEmail eq "") {
    		_root.Status = "Please enter your email address";
    	} else if (Greeting eq "") {
    		_root.Status = "Please enter a greeting message";
    	} else if (IntroMessage eq "") {
    		_root.Status = "Please enter a Intro Message";
    	} else {
    		gotoAndStop (3);
    		_root.Status = "Sending Ecard - Please Hold";
    		loadVariablesNum ("SendEcard.php", 0, "POST");
    	}
    }
    Last edited by Izlude; 07-19-2009 at 04:17 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center