Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unicode mail by .Net

Status
Not open for further replies.

nnmmss72

Programmer
May 14, 2006
110
IR

i want to send an email by .net C# as UTF-8, so i did as following



MailMessage myMail=new MailMessage();
myMail.To=Request.Form("ToText");
myMail.FromRequest.Form("FromText");
myMail.BodyFormat=MailFormat.Html;
myMail.Body=Request.Form("BodyText");;
myMail.Subject="Polling";
myMail.BodyEncoding=MailEncoding.Base64;
SmtpMail.SmtpServerSmtpServer;
SmtpMail.Send(myMail);

but it gives this error on compiling
"Cannot implicitly convert type 'System.Web.Mail.MailEncoding' to "System.Text.Encoding'" on line
myMail.BodyEncoding=MailEncoding.Base64;

what is it?
 
try this
Code:
myMail.BodyEncoding=System.Text.Encoding.UTF8;
 

this did
myMail.BodyEncoding=System.Text.UTF8Encoding.UTF8
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top