Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending UTF encoded mail

Status
Not open for further replies.

krigbert

Programmer
Jun 2, 2005
95
NO
I'm using a simple form to allow users to send emails through flash. The problem is, that the emails need to be unicode, as the site is Norwegian. The form is in flash, but I don't think that's where the problem is (the flash manual says "By default, Flash Player 7 and later assumes that all text it encounters is Unicode encoded")

So I'm wondering if the php mail() function does the same.

illustration and webdesign
 
it is agnostic to whatever you throw at it. ensure that you send the right content headers to specify utf (and that the clients support it)
 
I'm very much a n00b, though - so I wouldn't know how to do that. My script for the mail is as simple as:

Code:
mail($toAddy, $subject, $message, "From: $navn\nReply-To: $from\nX-Mailer: PHP/" . phpversion());

How do I add encoding to that? Is it just an argument like "encoding: UTF16"?

illustration and webdesign
 
Hup! Never mind, all I had to do was add the line "declare(encoding = 'utf-8');" at the beginning of the file. Thanks for answering, though :)

illustration and webdesign
 
...Or at least it worked when I sendt a message with the script to myself.... When someone else tried it, it didn't work - but sending messages with weird characters to him with Gmail does work.

WTF, as they say on the internets :|

illustration and webdesign
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top