A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Sending mail using as and php.

  1. #1
    Senior Member MagnusVS's Avatar
    Join Date
    May 2005
    Location
    Oslo, Norway
    Posts
    764

    Sending mail using as and php.

    Hi. I have this contact form where i use as and php to send mails from the site .
    My problem is that the site is norwegian, and we have three special characters ( æ, ø and å ).

    Now... when i write these into the form everything's ok, but when i send them using the php, these characters is messed up by the time i receive them in my mail. (e.g. "å" is converted to "Ã¥")

    Does anybody know how i can fix this?

    Thanks alot!

  2. #2
    Grandmaster Flash
    Join Date
    Apr 2004
    Location
    Edinburgh, Scotland
    Posts
    139
    Hi Magnus

    This looks like an encoding problem. Perhaps PHP is handling this as an ASCII or UTF-7 string. You want to handle it as a UTF-8 or similar (which contains more characters like european accents, etc). Due to the fact I haven't used PHP for a while I'm not exactly sure how to set this. Perhaps you could modify the PHP script so that it writes to a text file, and see if you get the same results. If you don't then it may be the encoding in the email.

    Sorry I can't help any more, but maybe it will point you in the right direction?

    HTH
    If it ain't broke, don't fix it.

  3. #3
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    This, in the PHP script, will decode the variable $message. Just change it for your own PHP variable.

    $message=utf8_decode($_POST['message']);

    gparis

  4. #4
    Senior Member MagnusVS's Avatar
    Join Date
    May 2005
    Location
    Oslo, Norway
    Posts
    764
    That works great!

    Thanks alot, both of you!

  5. #5
    Grandmaster Flash
    Join Date
    Apr 2004
    Location
    Edinburgh, Scotland
    Posts
    139
    Hi Magnus

    This looks like an encoding problem. Perhaps PHP is handling this as an ASCII or UTF-7 string. You want to handle it as a UTF-8 or similar (which contains more characters like european accents, etc). Due to the fact I haven't used PHP for a while I'm not exactly sure how to set this. Perhaps you could modify the PHP script so that it writes to a text file, and see if you get the same results. If you don't then it may be the encoding in the email.

    Sorry I can't help any more, but maybe it will point you in the right direction?

    HTH
    If it ain't broke, don't fix it.

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