Hi there!

I use a PHP Script (see below) to send Mail from a Flash Form contained in a .swf File to various selected recipients.

Everything is running fine.

The only problem I am experiencing is with accented characters (eacute, egrave, ecircumflex, etc) which are used in French language.

If I use them wherever in the message (in the sender name or in the body as well) ALL the text following the first accented character is lost and not visible in the received message.

I noticed the same problem when receiving some registration confirmation automated messages from some french forums or organizations...

Does anybody has a solution?

If necessary, I also can post the 'smtp.php' functions file on which the following script depend to complete its job.

Many thanks in advance for any help.

Best regards.

PHP SCRIPT:

<?php
require("smtp.php");
$destinataire= $POST["courriel" ];
$s_name= $
POST["sender_name" ];
$s_mail= $POST["sender_mail" ];
$tomyfriend= $
POST[ "full" ];
$subject=stripslashes ($POST ["sender_subject" ]);
$body=stripslashes ($
POST ["sender_message" ]);
$body .= "\n\n---------------------------\n";
$body .= "Envoi de courriel par : $s_name <$s_mail> \n ";

$from="$s_mail";
$to="$destinataire";

$smtp=new smtp_class;

$smtp->host_name="mail.germaris.com";
$smtp->localhost="";
$smtp->direct_delivery=0;
$smtp->timeout=90;
$smtp->data_timeout=0;
$smtp->debug=1;
$smtp->html_debug=1;
$smtp->pop3_auth_host="";
$smtp->user="";
$smtp->realm="";
$smtp->password="";

if($smtp->direct_delivery)
{
if(!function_exists("GetMXRR"))
{
$NAMESERVERS=array();
include("getmxrr.php");
}
}
if($smtp->SendMessage(
$from,
array(
$to
),
array(
"From: $s_name <$s_mail>",
"To: $to
($tomyfriend)",
"Subject: $subject",
"Date: ".strftime("%a, %d %b %Y %H:%M:%S %Z")
),
"$body"))
print "Message sent to $to OK.\n";
else
print "Cound not send the message to $to.\nError: ".$smtp->error."\n"
?>

    It's probably encoding your email is some way. Do your webpages have correct encoding types on them?

    I'm dealing with accents right now too... 😉

    I also think you will need to add an encoding type in the email headers. And if you are sending things as html then converting your characters to htmlentities I bet this would help as well.

    Good luck...v

      I'm dealing with accents right now too... 😉
      ........ ............
      Good luck...v

      Good luck to you too!!!
      Very good link opening new horizons... :-)

      I already solve part of the problem but not for the circumflexes and dieresis... :-(

      I'll give you a followup.

      Best regards,

      Gerard

        Write a Reply...