character problem when sending email!

  • Thread starter Thread starter Jeff
  • Start date Start date
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
 
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).
 
Back
Top