A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 38

Thread: problem with php mailer

  1. #1
    Senior Member
    Join Date
    Jan 2001
    Posts
    131
    here's my php script, form.php

    <?

    $ToEmail = "myaddress@site.com";

    $EmailBody = "Sent By: $name\nSenders Email: $email\n\n Message Sent:\n$message\n";

    $EmailFooter="\nThis message was sent by: $name from $REMOTE_ADDR If you feel that you
    recieved this e-mail by accident please contact us at http://www.site.com";

    $Message = $EmailBody.$EmailFooter;

    mail($ToEmail, $subject, $message, "From: ".$name." <".email.">");

    ?>


    in Flash, I have a form mc in a swf that loads into another movieclip in the main movie. in the form mc I have text fields variables: name, email, subject and message. to the send button of the form, attached code:

    on (release) {
    if (name eq "" or subject eq "" or message eq "" or email eq "") {
    gotoAndStop(2);
    } else {
    loadVariablesNum ("form.php", this, "Post");
    gotoAndStop(3);
    }
    }


    when I tried sending the form, a new window pops up looking like its processing but evetually it stops and nothing happened ...nothing gets sent. Any help would be great. Thanks!

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    you cannot use loadVariablesNum with the this argument, only loadVariables
    If your php is 4.1 or newer, you may have to add
    $subject = $_POST[subject];
    etc. near the top of your script for all the variables you are expecting

    Musicman

  3. #3
    Senior Member
    Join Date
    Jan 2001
    Posts
    131
    hi thanx I tried that but didn't work. anything else wrong with the code? thx

  4. #4
    Senior Member
    Join Date
    Mar 2002
    Posts
    161
    Have you tried adding a print statement to the php script to be certain the email data is being transferred?

    Code:
    <? 
    
    print "Name=$name<br>Subject=$subject<br>Message=$message";
    
    $ToEmail = "myaddress@site.com"; 
    
    $EmailBody = "Sent By: $name\nSenders Email: $email\n\n Message Sent:\n$message\n"; 
    
    $EmailFooter="\nThis message was sent by: $name from $REMOTE_ADDR If you feel that you 
    recieved this e-mail by accident please contact us at http://www.site.com"; 
    
    $Message = $EmailBody.$EmailFooter; 
    
    mail($ToEmail, $subject, $message, "From: ".$name." <".email.">"); 
    
    ?>
    Have you tried creating a URL to test the script via the browser rather than the movie?
    http://www.yourdomain.com/phpflashem...$message=hmmmm

  5. #5
    Senior Member
    Join Date
    Jan 2001
    Posts
    131

    jerry

    hi I tried that but it didn't do anything. Please help. I know I have php running but is it possible that mail() simply doesn't work? how can I test it?

    TIA

  6. #6
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    how can I test it?
    Make a script like that
    <?
    mail('you@somewhere.com', 'test', 'test mail from server');
    ?>

    and see whether the mail arrives - certain hosting companies sometimes delay up to a few hours

    Musicman

  7. #7
    Senior Member
    Join Date
    Jan 2001
    Posts
    131
    that didnt' work either. now the site is actually hosted on my own computer(server). I know that php's mail() relies on the server's mail system, could that be the reason why it doesn't work? how can I make sure?

    thx!

  8. #8
    Senior Member
    Join Date
    Aug 2001
    Posts
    161
    your running it on you PC.

    in you php.ini file you need to change the following things

    [mail function]
    SMTP = your ISP mail sever ;for win32 only
    sendmail_from = me@yahoo.com ;for win32 only

    fill in your own variabels.

    hope this helps

  9. #9
    Senior Member
    Join Date
    Jan 2001
    Posts
    131
    actually I'm running on Mac OS X.

  10. #10
    Senior Member
    Join Date
    Aug 2001
    Posts
    161
    hey you want to tell me where you got your installer for the mac os?? but about your problem you need to find you php config file. i am not sure what it is called on the mac. but it will have the same set up most likely. and change what i said in the last reply

  11. #11
    Senior Member
    Join Date
    Jan 2001
    Posts
    131
    I got the installer long time ago from some site but I can't remember now. if you go on php.net you might find a link to it.

    I will what u said. by the way, what's the send_from variable for?

    Thx

  12. #12
    Senior Member
    Join Date
    Aug 2001
    Posts
    161
    it is the default value from who sent the e-mail thats all

  13. #13
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    since OSX is a unix-type system, php is expecting a sendmail program for mail to work - you may have to edit the php.ini only if sendmail is in an unusual location

    Musicman

  14. #14
    Senior Member
    Join Date
    Aug 2001
    Posts
    161
    the problem with that is it isn't a .ini file. its has diferent file extention. and if your runing apche you might have to change that config file too.

    Chuck

  15. #15
    Senior Member
    Join Date
    Jan 2001
    Posts
    131
    musicman: a sendmail program you mean like outlook or mail (in mac)??

    GreenElephant: I am using apache. which config you're suggesting to change?

    I just changed the mail function in php.ini to the right smtp and sendmail_from, didn't work either.

    Thanks really appreciate it.

  16. #16
    Senior Member
    Join Date
    Aug 2001
    Posts
    161
    mybad i guess i didn't change the apache config. sorry man i am not sure whats up.

  17. #17
    Senior Member
    Join Date
    Aug 2001
    Posts
    161
    so you changed the SMPT to the same server that you have your mail program set to. by mail program i mean outlook, mail stuff like that???

    chuck

  18. #18
    Senior Member
    Join Date
    Jan 2001
    Posts
    131

    I'm really lost

    I'm really lost

  19. #19
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    Unix style is to split the mail function into components.
    Outlook is both a Mail User Agent (it allows to view and write mails) and a Mail Transfer Agent (it takes care of fetching incoming mail from your hosting company and sending outgoing mail)
    The sendmail program is just a MTA - it accepts mails sent to your computer from the outside, and knows how to send mails you might write with any MUA, and it knows how to route mails (this is something that outlook does handle: consider a setup where anyname@yourdomain.com gets delivered to a shared mailbox with your hosting company and there are a few networked machines; you would want one machine to pick up the mails at the provider and then distribute them to the machines on your local net)

    Maybe you have to install the mailserver package on your machine to get it - but I would not expect that changing variables labelled "for windows" only in a mac config would improve the situation

    Musicman

  20. #20
    Senior Member
    Join Date
    Jan 2001
    Posts
    131
    ok I've set the smtp in php.ini to the smtp specified in my Mail program. and I only use Mail, (no Outlook) now what am I supposed to do next? it's still not working. sorry to be such a bother, I thought this is supposed to be easy.

    many thanks.

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