Gossamer Forum
Home : General : Perl Programming :

Need Some Help

Quote Reply
Need Some Help
Hello, i have this script here which sends an e-mail.
The problem is that when i use greek letters in the form i get them in my e-mail as weird characters.
I assume that i must change the charset to iso-8859-7
Could anyone help by telling me how i can do that?
thanks
Unsure

if($http_from)
{ print MAIL "From: $http_from\n"; }
else
{ print MAIL "From: $form{'email'}\n"; }


print MAIL "Reply-to: $form{'email'}\n";
print MAIL "Subject:Testing Guest Book\n";
print MAIL "\n";
print MAIL $separator;
print MAIL "Guest Book\n";
print MAIL $separator;
print MAIL "Name: .........$form{'title'} $form{'name'}\n";
print MAIL "Hospital: .....$form{'hospital'}\n";
print MAIL "Address: .....$form{'address'}\n";
print MAIL "Telephone: ..$form{'tel'}\n";
print MAIL "Fax: .............$form{'fax'}\n";
print MAIL "E-mail: ......$form{'email'}\n";
print MAIL $separator;
print MAIL "Interest area:\n";
print MAIL $separator;
print MAIL "$form{'renal'}\n";
print MAIL "$form{'diagnostic'}\n";
print MAIL "$form{'cardiovascular'}\n";
print MAIL "$form{'blood'}\n";
print MAIL "$form{'other'}\n";
print MAIL $separator;
print MAIL "Remarks:\n";
print MAIL "$form{'remarks'}\n";
print MAIL $separator;
close (MAIL);
print "<HTML>";
print "<TITLE>Form successfully sent</TITLE>\n";
print "<H1 align=center>Form successfully sent</H1>\n";
print "<H2 align=center>Thank you for taking the time to fill out our Guest Book.</H2>";
print "</BODY>";
print "</HTML>";
exit(0);
Quote Reply
Re: [dallasv] Need Some Help In reply to
Try preceding with:

print MAIL "Content-type: text/plain charset=iso-8859-7\r\n";

(to override Sendmail default header)

----
Cheers,

Dan
Founder and CEO

LionsGate Creative
GoodPassRobot
Magelln
Quote Reply
Re: [dallasv] Need Some Help In reply to
Hello, that doesnt seem to work for some reason:
this is what i get in my inbox:
Name: .........&#206;&#180;&#206;&#207;&#206;&#180; &#207;&#206;&#180;&#207;&#206;&#206;&#180;I added what you said here:if($http_from)
{ print MAIL "From: $http_from\n"; }
else
{ print MAIL "From: $form{'email'}\n"; }


print MAIL "Content-type: text/plain charset=iso-8859-7\r\n";


print MAIL "Reply-to: $form{'email'}\n";
print MAIL "Subject:Testing Guest Book\n";
print MAIL "\n";
print MAIL $separator;
print MAIL "Guest Book\n";
print MAIL $separator;
print MAIL "Name: .........$form{'title'} $form{'name'}\n";
print MAIL "Hospital: .....$form{'hospital'}\n";
print MAIL "Address: .....$form{'address'}\n";
print MAIL "Telephone: ..$form{'tel'}\n";
print MAIL "Fax: .............$form{'fax'}\n";
print MAIL "E-mail: ......$form{'email'}\n";
print MAIL $separator;
print MAIL "Interest area:\n";
print MAIL $separator;
print MAIL "$form{'renal'}\n";
print MAIL "$form{'diagnostic'}\n";
print MAIL "$form{'cardiovascular'}\n";
print MAIL "$form{'blood'}\n";
print MAIL "$form{'other'}\n";
print MAIL $separator;
print MAIL "Remarks:\n";
print MAIL "$form{'remarks'}\n";
print MAIL $separator;
close (MAIL);
print "<HTML>";
print "<TITLE>Form successfully sent</TITLE>\n";
print "<H1 align=center>Form successfully sent</H1>\n";
print "<H2 align=center>Thank you for taking the time to fill out our Guest Book.</H2>";
print "</BODY>";
print "</HTML>";
exit(0);

thanks,,
Quote Reply
Re: [dallasv] Need Some Help In reply to
Try this -
print MAIL "Content-type: text/html charset=UTF-8\r\n";

It worked for me with Japanese characters.
See the following thread that Andy helped me with, it's almost identical to your question.
http://gossamer-threads.com/...?post=277358;#277358

Simon.
Quote Reply
Re: [jai] Need Some Help In reply to
Thank you for your time...
That didn't work either though :-(
Quote Reply
Re: [dallasv] Need Some Help In reply to
What do you have the html document character set as ?

The form submits as this type from this document.

So you get what it sends.

An example of both html and script might be handy to further troubleshoot.

Greek to me other wise.

Thanks

Cornball