Results 1 to 9 of 9

Thread: php email

  1. #1
    Join Date
    Dec 2007
    Location
    Mississauga
    Posts
    166
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default php email

    I am using a flash form and when 'send' is hit it communicates with a php page which then sends me an email with the contents of the message, senders email and name.

    Everything works........ kind of, but I am getting this string of code in my email.

    <TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Arial\" SIZE=\"10\" COLOR=\"#333333\" LETTERSPACING=\"0\" KERNING=\"0\">Message content</FONT></P></TEXTFORMAT>

    As you can see "Message Content" is all I want but it's like it is shooting over an html markup which isnt in my flash file or in the php.

    php code is as follows.

    PHP Code:
    <?php

    $sendTo 
    "xxxx@xxxxxx.com";
    $subject "Comment";

    $headers "From: " $_POST["email"] ."\r\n";

    $headers .= "Reply-To: " $_POST["email"] . "\r\n";

    $headers .= "Return-path: " $_POST["email"];

    mail($sendTo$subject$message$headers);

    ?>
    The only thing that displays right is the Subject, even the reply address (senders email) does display, but again with that html mark up so when you hit reply I get there email address but then the html code after it. And it's long.

    Anyone got anything like this before and were able to solve it?


    -- Nate

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    1. You should check to see if your textfield in Flash is set to parse HTML. That might be a cause of your problems.

    2. Wrap the variables with strip_tags() and see if that makes any difference

  3. #3
    Join Date
    Dec 2007
    Location
    Mississauga
    Posts
    166
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default

    ok setting flash to parse HTML I have no idea what that means or how to do it, but I would imagine that is not the problem as data is getting from my flash file to my email.

    As for the strip_tags() I looked into the document and I think I did what they were describing but it messed everything up and stop sending emails.

    The only thing I found makes a diff is if I drop these lines into the php.
    Code:
    $headers  = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    I found doing this brought the message to me without the html tags wrapping around the message, problem though is it seems to be cancelling out the other two headers.
    Code:
    $headers = "From: " . $_POST["name"] ."<" . $_POST["email"] .">\r\n";
    $headers .= "Reply-To: " . $_POST["email"] . "\r\n";
    So the email arrives labeled as "CGI-Mailer" the subject is still fine but the reply address and name are gone, so I added this to the message section.
    Code:
    $message = "From: " . $_POST["name"] ." " . $_POST["email"] ." " . $_POST["message"] ."\r\n";
    So that I can get the persons name and email address to reply to them.

    I'm just confused because I have used this before and it didn't give me any problems. Is there someway to make all the 4 headers I have described work together instead of cencelling each other out?

  4. #4
    Join Date
    Jan 2008
    Posts
    51
    Thanks
    46
    Thanked 1 Time in 1 Post

    Default

    That's because you're resetting the headers by not concatinating to what you already have.

    The headers should look like this (notice the equal sign):

    PHP Code:
    $headers  'MIME-Version: 1.0' "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' "\r\n";
    $headers .= "From: " $_POST["name"] ."<" $_POST["email"] .">\r\n";
    $headers .= "Reply-To: " $_POST["email"] . "\r\n"

  5. #5
    Join Date
    Dec 2007
    Location
    Mississauga
    Posts
    166
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default

    I just tried it again with the change posted by "ReadyToLearn" and the message content shows up properly now but the reply address still is coming in like this.

    John Doe jdoe@email.com > [TEXTFORMAT LEADING=\"2\"P ALIGN=\"LEFT\"FONT FACE=\"Arial\" SIZE=\"10\" COLOR=\"#353C53\" LETTERSPACING=\"0\" KERNING=\"0\"/FONT/P/TEXTFORMAT<TEXTFORMAT LEADING=\"2\"P ALIGN=\"LEFT\"FONT FACE=\"Arial\" SIZE=\"10\" COLOR=\"#333333\" LETTERSPACING=\"0\" KERNING=\"0\"/FONT/P/TEXTFORMAT]

    I don't know where to go from here this is kind of bizzar to me.

  6. #6
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    can you show us the code.. showing us the output only doesnt help

  7. #7
    Join Date
    Dec 2007
    Location
    Mississauga
    Posts
    166
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default

    The code for the php is as follows...
    Code:
    <?php
    
    $sendTo = "xxxx@xxxxx.com";
    $subject = "Inquiry/Comment";
    
    $headers  = 'MIME-Version: 1.0' . "\r\n"; 
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; 
    $headers .= "From: " . $_POST["name"] ."<" . $_POST["email"] .">\r\n"; 
    $headers .= "Reply-To: " . $_POST["email"] . "\r\n";
    
    $message = "From: " . $_POST["name"] ." " . $_POST["email"] ." " . $_POST["message"] ."\r\n";
    
    mail($sendTo, $subject, $message, $headers);
    
    ?>
    The code for the send button...
    Code:
    on(release) {
    	form.loadVariables("sendmail.php", "POST");
    }
    Then this AS is in the MC which contains the text fields...
    Code:
    onClipEvent(data){
    	nextFrame();
    }

  8. #8
    Join Date
    Dec 2007
    Location
    Mississauga
    Posts
    166
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default

    Anyone able to help me out on this one?

    I am not running into a problem where I hit send and nothing happens, I get no email now and the firm does not jump to the next frame to indicate to the user their info has been submitted. it just sits there now.

    I'm just really lost here.

  9. #9
    Join Date
    Dec 2007
    Location
    Mississauga
    Posts
    166
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default

    * Corr emails are getting through now it was a problem with my ISP. Problem solved, no need for help with this one.

Bookmarks

Posting Permissions

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