[FX.php List] Filemaker French character and PHP mail function

Dale Bengston dbengston at tds.net
Wed Jan 27 11:49:06 MST 2010


I second the recommendation of using SwiftMailer. It solved many of these same problems when we switched to it.
Dale

 --
Dale Bengston
Streamline Studio, LLC
www.streamline-studio.com

On Jan 27, 2010, at 12:19 PM, Leo R. Lundgren wrote:

> This might not be the answer you are looking for, but I highly recommend that you start using a decent library that is designed to handle these specific tasks *for* you, instead of trying to manually do things that have only minimal support in PHP.
> 
> So in short, download SwiftMailer and get going. It's at www.swiftmailer.org and here's a small quick intro: http://swiftmailer.org/docs/message-quickref
> 
> Regarding the encoding, it is UTF-8 by default in SM.
> 
> To comment on the code you pasted, it looks like you are doing a huge amount of work just to send a mail. What I mean by that is the "prefabricated" mail body that you are using. It will be soo much simpler with a real mailing library.
> 
> In any case, it looks like the mail contents itself explicitly says that it is iso-8859-1. Maybe that is your problem, that nomatter what you do, the mail contents still says this, and the mail client lives by it. If there are further issues I would guess they're related to files not being saved as UTF-8 or something.
> 
> 
> 27 jan 2010 kl. 15.01 skrev Dominique Uris:
> 
>> Hi List,
>> 
>> I'm trying to sent some french character as csv file email attachment. I'm able to sent the email attachment correctly but all the french character get translated to other character like "ç" to "ç" , etc. I tried using php function "mb_convert_encoding" without any success using the line $string = mb_convert_encoding($input_string, "iso-8859-1", "UTF-8");
>> 
>> I have to say I copied my code to sent email with attachment from the internet, because I was on a short schedule so maybe there also something wrong in the code...
>> 
>> 
>>> $subject = $subject;
>>> $to = $email_to;
>>> $headers = "From: ".$email_from."\r\nReply-To: ".$email_from."\n";
>>> $headers .= 'MIME-Version: 1.0' . "\n";
>>> $headers .= 'Content-Type: multipart/mixed;
>>>   boundary="----=_NextPart_001_0011_1234ABCD.4321FDAC"' . "\n";
>>> 
>>> $message = '
>>> 
>>> This is a multi-part message in MIME format.
>>> 
>>> ------=_NextPart_001_0011_1234ABCD.4321FDAC
>>> Content-Type: text/plain;
>>>       charset="iso-8859-1"
>>> Content-Transfer-Encoding: 7bit
>>> 
>>> '. $body .'
>>> 
>>> ------=_NextPart_001_0011_1234ABCD.4321FDAC
>>> Content-Type: text/csv;  name="';
>>> 
>>> $message .= "$thisfile";
>>> $message .= '"
>>> Content-Transfer-Encoding: base64
>>> Content-Disposition: attachment; filename="';
>>> $message .= "$thisfile";
>>> $message .= '"
>>> 
>>> ';
>>> $message .= $encoded;
>>> $message .= '
>>> 
>>> ------=_NextPart_001_0011_1234ABCD.4321FDAC--
>>> 
>>> ';
>> 
>> Thanks in advance.
>> 
>> Dominique
>> dominique at macsol.ca_______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
> 
> 
> 
> -|
> 
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list



More information about the FX.php_List mailing list