Click here to Skip to main content
15,899,314 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am developing a Asp.Net web application. In that I use SMTP method to send mails manually. Here In from address in web config I am using french characters, when they are present and deployed the site is being down and 500 error is displaying

XML
<system.net>
   <mailSettings>
     <smtp from="Marché Matériel < igsupport@dfmstore.com >" deliveryMethod="Network">
       <network host="172.00.0.123" port="25" enableSsl="false" userName="pbtest" password="pa55w0rd!" />
     </smtp>
   </mailSettings>
 </system.net>



Please help me out. In abve bold content is the french character used.Thanks in advance.
Posted

1 solution

In Visual Studio, when saving web.config, you should select the encoding (UTF-8) under File -> Advanced -> Save Options.
You should also change the < and > to &lt; and &gt; respectively.

HTML
<smtp from="Marché Matériel &lt; igsupport@dfmstore.com &gt;" deliveryMethod="Network">
 
Share this answer
 
v3
Comments
Maciej Los 8-Oct-14 8:43am    
+5
Fadi Chamieh 9-Oct-14 14:05pm    
Thanks
jing567 14-Oct-14 2:22am    
Hi Fadi Chamieh,
Yia I have placed < > in the format you have suggested only... I dont have problem with them..When I am trying to place this code in IIS the whole site is geeting down because of the é . Moreover the I have UTF-8 property only...
I have doen HTML encode for that specail character and tries to read the Encoded text from Web config and at that code location I have decoded the web config french text.
If you are really intested I would provide the sample codee.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900