RE: [PHP] SMTP and changing the character set

2004-05-08 Thread Dave G
Todd,

 Is there a way to specify a character set in a SMTP email?

I've found that SMTP is really, really very particular about how you
apply spacing and carriage returns when passing a content type header
from PHP. In the PHP mail() function, you want to add the content type
header like so:

?php
$contentType =  \r\nContent-Type: text/plain; charset=UTF-8;
mail($toaddress, $subject, $mailcontent, $contentType);
?

In particular, take note of the space before \r\n. Without it, the
content type header would not work. I had to do a lot of experimenting
before I discovered this. You may have to some experimenting as well, as
I'm not sure if all servers behave the same on this issue.

Hope that helps.

-- 
Yoroshiku!
Dave G
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] SMTP and changing the character set

2004-05-08 Thread Todd Cary
Thank you both for the help.  One more question: can SMPT use the Asian 
character set since it is 16 bits?

Todd

Dave G wrote:

Todd,


Is there a way to specify a character set in a SMTP email?


I've found that SMTP is really, really very particular about how you
apply spacing and carriage returns when passing a content type header
from PHP. In the PHP mail() function, you want to add the content type
header like so:
?php
$contentType =  \r\nContent-Type: text/plain; charset=UTF-8;
mail($toaddress, $subject, $mailcontent, $contentType);
?
In particular, take note of the space before \r\n. Without it, the
content type header would not work. I had to do a lot of experimenting
before I discovered this. You may have to some experimenting as well, as
I'm not sure if all servers behave the same on this issue.
Hope that helps.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] SMTP and changing the character set

2004-05-07 Thread Chris
SMTP, just like HTTP, uses the Content-Type header. So you can do something
like this:

Content-Type: text/plain; charset=US-ASCII

Just add that to the header argument of the mail function, if that's what
you're using.

Chris

-Original Message-
From: Todd Cary [mailto:[EMAIL PROTECTED]
Sent: Friday, May 07, 2004 4:51 PM
To: [EMAIL PROTECTED]
Cc: Kim Wagner; Brian Feifarek; Gus Scherer
Subject: [PHP] SMTP and changing the character set


Is there a way to specify a character set in a SMTP email?

Todd

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php