character problem when sending email!

J

Jeff

Hey

asp.net 2.0

I've configured PasswordRecovery to send password to the user:
<MailDefinition Subject="Ditt Passord"
BodyFileName="~/Emails/PasswordRecovery.txt" >
</MailDefinition>

The problem is that the Norwegian specific characters in PasswordRecovery
are replaced by some other characters..
For example "å" is replaced with "?". So sentence like " anbefaler vi deg å
endre" becomes "anbefaler vi deg ? endre".
("anbefaler vi deg å endre" means in English "we recommend you to change")

How should I go about fixing this problem? add some code in the
OnSendingMail method which perform a string search & replace of the body
(search for ? and replace it with å)... or are there some better ways of
fixing this problem?

Best Regards
 
G

Göran Andersson

Jeff said:
Hey

asp.net 2.0

I've configured PasswordRecovery to send password to the user:
<MailDefinition Subject="Ditt Passord"
BodyFileName="~/Emails/PasswordRecovery.txt" >
</MailDefinition>

The problem is that the Norwegian specific characters in PasswordRecovery
are replaced by some other characters..
For example "å" is replaced with "?". So sentence like " anbefaler vi deg å
endre" becomes "anbefaler vi deg ? endre".
("anbefaler vi deg å endre" means in English "we recommend you to change")

How should I go about fixing this problem? add some code in the
OnSendingMail method which perform a string search & replace of the body
(search for ? and replace it with å)... or are there some better ways of
fixing this problem?

Best Regards

It looks like the mail is using an encoding that doesn't support those
characters.

I didn't find any property for setting the body encoding in the
MailDefinition, or in the smtp settings in the config.

What encoding did you use when you created the text file? Try to save
the text file as Unicode (Notepad has this option).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top