Results 1 to 9 of 9

Thread: Flash Web Form and PHP

  1. #1

    Default Flash Web Form and PHP

    I am using the code below to try to get my site to send me information from a webform made in Flash. It was working fine when I was testing it locally, but now that it is uploaded it is not sending the form successfully.

    Any suggestions?

    Thanks.

    __________________________________________________ _______________
    <?php
    require_once "Mail.php";

    $from = "Sender <sender@example.com>";
    $to = "Me <me@myemail.net>";
    $subject = "Feedback from Site";
    $message .= 'First Line: '.$_POST['FirstLineofForm'] ."\n\n";
    $message .='SecondLine: '.$_POST['kSecondLineofForm'] ."\n\n";


    $host = "smtp.myemail.net";
    $username = "myUsername";
    $password = "myPassword";


    $headers = array ('From' => $from,
    'To' => $to,
    'Subject' => $subject);
    $smtp = Mail::factory('smtp',
    array ('host' => $host,
    'auth' => true,
    'username' => $username,
    'password' => $password));

    $mail = $smtp->send($to, $headers, $message);

    if (PEAR::isError($mail)) {
    echo("<p>" . $mail->getMessage() . "</p>");
    } else {
    echo 'sent=OK';
    // echo("<p>Message successfully sent!</p>");
    }
    ?>

  2. #2
    Early Out's Avatar
    Early Out is offline Former Moderator, Still Respected
    Join Date
    Mar 2006
    Location
    Sector R
    Posts
    4,650

    Default

    This is completely out of my league, but just a thought: does your email provider allow connections to its SMTP server from a machine that's not on its network? In other words, when you're testing this from your own PC, you're connected to their network, but when a Bluehost server tries to make the same connection, it's not. So, it might need user authentication, for example. Either that, or use the Bluehost SMTP server (mail.yourdomain.com), user ID, and password.

    Just a shot in the dark, and one that might be totally off target.

  3. #3

    Default Flash & PHP

    Thanks, that's a good idea. I'll give it a try tonight.

    Bluehost switched me over to PHP 5 yesterday and I was hoping that would help, but it didn't...

  4. #4
    Join Date
    Feb 2006
    Location
    Somewhere where I don't know where I am
    Posts
    2,155

    Default

    PHP4 and PHP5 have the same basic structure. PHP5 is object oriented. In your case, the script will run the same on either. If there is a PHP error in PHP4, the error will still be there in PHP5

    I've used PHPMailer (http://phpmailer.sourceforge.net/) before it's worked great. Let me know if you need any help setting it up. It's basically the same as what you're using now, but works a little better.
    Last edited by areidmtm; 05-31-2006 at 08:16 AM.
    Sign Up Now!
    Unlimited Storage, Unlimited Transfer, Host Unlimited domain names, 1 Free Domain Name
    BlueHost Features | BlueHost Help Desk | Become a BlueHost Affiliate | BlueHost CEO Blog
    (888) 401-4678 | Create a support ticket

  5. #5
    Join Date
    Feb 2006
    Location
    Florida, USA
    Posts
    153

    Default

    Have you considered using simply the mail() function? If you are trying to use a remote SMTP server it probably will not work because of bluehosts' firewall on non-dedicated IPs.
    BlueHost Knowledge Base, it is quite helpful, you should read through it.

  6. #6

    Default PHP & Flash Forms

    It's working!

    PHPMailer is a much better solution and I switched to the Bluehost SMTP server and now I have a beautiful form that actually works.

    Thanks for all the great suggestions!

  7. #7
    Join Date
    Feb 2006
    Location
    Somewhere where I don't know where I am
    Posts
    2,155

    Default

    Glad to hear that everything is working now
    Sign Up Now!
    Unlimited Storage, Unlimited Transfer, Host Unlimited domain names, 1 Free Domain Name
    BlueHost Features | BlueHost Help Desk | Become a BlueHost Affiliate | BlueHost CEO Blog
    (888) 401-4678 | Create a support ticket

  8. #8
    Early Out's Avatar
    Early Out is offline Former Moderator, Still Respected
    Join Date
    Mar 2006
    Location
    Sector R
    Posts
    4,650

    Default

    It's an illustration of something I discovered a long time ago - there's never just one problem. It's always two problems, one of which masks the effects of the other!

    Glad it's all working.

  9. #9
    Join Date
    May 2007
    Posts
    11

    Default

    How did you set up the source forge php mailer? I am running on Mac OSX...

Posting Permissions

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