I have a test html page with form which uses sendmail to send an email with data from the form. The input data includes characters like éêä £ €
The test page and the script it runs are on an Apache Linux web server.
if the html page has a character set of windows-1252 (default for Expression Web) those characters come out correctly in the email.
if the html page has character set of utf-8 those characters come out as garbled text (eg: £ €).
here is the sendmail code:
unless (open(LOG_FILE, ">test_sendmail_log.txt")) { die "Couldn't open output file test_sendmail_log.txt\n"; } print LOG_FILE "$body"; open (MERCHANT_MAIL, "|/usr/sbin/sendmail -oi -t") or die "Can't fork for sendmail: $!\n"; print MERCHANT_MAIL "To: $send_addr\n"; print MERCHANT_MAIL "From: $from_addr\n"; print MERCHANT_MAIL "Subject: $subject\n\n"; print MERCHANT_MAIL $body; close (MERCHANT_MAIL); close(LOG_FILE);
A log file saved at the same time displays all characters correctly, whichever charset the html page has.
The html pages for which I am testing have charset=utf8 - how can I get sendmail to send such characters correctly?
Thank you
In reply to sendmail problem with utf-8 charset by combraxis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |