.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Problem to use unicode chars in yahoo mail

Posted By:      Posted Date: August 30, 2010    Points: 0   Category :.NET Framework
Hi i have a problem to send email via smtpClient class to yahoo mail. if i send a unicode email from non-Yahoo account to yahoo mail, it works correctly (display unicode chars correctly without any making change), but when i send from yahoo account to yahoo mail, it does not display characters correctly and i should change it's encoding to UTF8. can anybody help me to work-around this problem ? Please see my previous thread in this link. thanks in advancehttp://www.codeproject.com/KB/codegen/DatabaseHelper.aspx

View Complete Post

More Related Resource Links

SSIS 2005 - Send Mail Task - signature appended to email is garbled - unicode problem?

Hi, I'm pretty new to SSIS so go easy on me. I have a Send Mail Task to notify if a file cannot be imported - the mailbody is created on the previous step by a VB.NET script task to include the name of the file and the path it's been archived to. The problem I'm having is that while the body of the email I've created is displaying fine, our company's Exchange server appends a signature to all emails, and this is coming up as undisplayable characters, presumably due to some kind of unicode encoding problem. I've tried casting the email body in an expression to DT_STR (doesn't work as DT_STR "cannot be converted to a supported type" which seems a bit odd but never mind), DT_WSTR (garbled signature), DT_TEXT/DT_NTEXT (strange error on this one - "Attempted to read or write protected memory") none of those ideas worked, and I'm a bit stumped now. Can anyone help? I'm using SSIS 2005 with SP3

a problem in work with unicode chars in WHERE clause



I'm designing a website for Persian language

I create a stored procedure that contain :

SELECT @sqlstring = ' SELECT TOP ' + CONVERT(nvarchar,@RowCountUser) + ' Stars FROM SpecialAds WHERE REPLACE(REPLACE(MainGroup,NCHAR(1610),NCHAR(1740)),NCHAR(1603),NCHAR(1705)) = ''REPLACE(REPLACE(' + @MainGroup + ',NCHAR(1610),NCHAR(1740)),NCHAR(1603),NCHAR(1705))'' AND Status = ''verified'' ORDER BY Stars Desc';

EXEC (@sqlstring)

no record is not returned and printed :

Invalid column name : ...

but when I change code above to :

SELECT TOP 5 Stars FROM SpecialA

Path Too Long Problem. Accessing filenames longer than 260 chars using unicode and kernel32.dll.

I found this article a few weeks ago that provided a way to access files and folders past the 260 char length:


I put the code from "Finding Files and Folders" in a dll and wrote an app in vb accessing these functions.  However, the code randomly breaks on a specific kernel32 function call. 

I noticed that if the search finds a file (not folder) longer than 12 to 14 characters then it breaks on occasion.  This is strange because I would think it would either never break or always break.

Here's the line where it breaks:

// find next

found = FindNextFile(findHandle, out findData);

Any ideas?


System.Net.Mail HTML Template Problem


What do I need here ?????? To make this work??

Dim MassMail As New MailMessage()

        Dim Template As ??????????????

        MassMail.To.Add(New MailAddress(TextBox_massemailto.Text))
        MassMail.From = New MailAddress("You@me.com")

        ' MassMail.CC.Add()
        MassMail.Subject = TextBox_massemailsubject.Text
        MassMail.Body = TextBox_massemailBody.Text
        ' MassMail.Body = Template.BodyFileName = "EmailTemplates/BusinessAdBrochure.htm"
        MassMail.Priority = MailPriority.High

        Dim smtpclient As New SmtpClient("relay-hosting.secureserver.net")
        smtpclient.Credentials = New System.Net.NetworkCredential(""You@me.com"", "pasword")
        smtpclient.Port = 25
        smtpclient.EnableSsl = False

Problem with incoming mail to SharePoint Library - what is wrong with this?

I configured my incoming mail to a SharePoint 2010 library according to these instructions. http://intellects.in/2010/04/04/configuring-sharepoint-2010-document-libraries-with-exchange-server-2010-to-receive-mails-from-internalexternal-world/ I'm able to receive mail at the Exchange mailbox set up for the document library, but am unable to receive the document in the library itself.  I'm thinking it's because I have a problem with my naming - but I'm not sure how to solve it: I have a SharePoint box and an Exchange box. I've configured the SMTP virtual server with default domain of  server.domain.com .  I've also assigned it an alias of domain2.net I've configured incoming email in SharePoint Central Administration to use the address of mylist@domain2.net so that users can have a friendly url for sending documents to lists and libraries. I've created an Attended Domain in Exchange 2010 and set up an email address policy that speicifes all mailboxes receive an domain2.net address.  I have an MX record for the domain2.net address with a DNS server pointing to the Exchange box. I've created an SMTP Send Connector that points to the FQDN server.domain.com of my virtual server on my SharePoint box. With that connector, I've chosen to route mail through the same FQDN of server.domain.com , that of my SharePoint/IIS SMTP Virtual Server box. When I confi

Sending an e-mail with the content of a GridView in asp.net 2.0. problem

Hi experts,  I am Sending an e-mail with the content of a GridView in asp.net 2.0. Everything is working fine , but my problem is that  it is also sending "DELETE" LINKLabel to the email. Is there anyway so that only Content of Gridview will go to email and "Delete" Link will not go. Is it possible ??? Thanks in Advance

problem with sending mail by smtpclient

 hi , I have an aspx  page that sending a mail by smtp client , but it`s not work properly ! and pass an exeption : failur sending mail here is my code :   protected void BTN_Submit_Order_Click(object sender, EventArgs e) { MailMessage MailMsg = new MailMessage("Sales@anahidcorp.com", "test0@anahidcorp.com"); MailMsg.Subject = "?????"; MailMsg.Body = "????"; MailMsg.IsBodyHtml = false; MailMsg.BodyEncoding = System.Text.Encoding.Unicode; MailMsg.SubjectEncoding = System.Text.Encoding.Unicode; MailMsg.CC.Add("test1@anahidcorp.com"); MailMsg.CC.Add("test2@anahidcorp.com"); NetworkCredential cred = new NetworkCredential("Sales@anahidcorp.com", "mypass"); SmtpClient smtp = new SmtpClient("myserver"); smtp.UseDefaultCredentials = false; smtp.EnableSsl = true; smtp.Credentials = cred; try { smtp.Send(MailMsg); } catch ( SmtpException ex) { Response.Redirect("errpage.aspx?err=" +

System.Net.Mail e-mail header info problem

I'm new to using the system.net.mail class and I'm having trouble with a small program I'm writing.  I use my SendMessage() to send an email public static void SendMessage(string msg)         {             System.IO.File.Copy(mySource + msg, destSource + msg);             MailMessage mail = new MailMessage("from@me.com", "to@you.com, msg, "");                        Attachment attch = new Attachment(destSource + msg, "text/plain; format=flowed;reply-type=original"); //content-type text/plain                                   mail.Attachments.Add(attch);                                  MessagingCenter.client.Send(mail);             mail.Dispose();         } However, the email sent

How to create a page with the similar layout as yahoo mail inbox page?

I want to create a web page with a table on top and a scrollable panel. Similar layout to yahoo mail inbox page (list of inbox messages on top and the panel displaying details). Further more, the table displays general information list and the panel displays a list of detail records. when a user clicks a table row, the panel is going to jump to the specific detail row, similar to html anchors. Do you know how to implement this? Thanks! 

Microsoft Word Mail Merge Problem


I wrote code to create label from Microsoft Word Mail Merge using Visual Studio 2008 ASP.NET C#. This is my code:

public void CreateLabel(string strCSVPath, string strTemplatePath)
            Object fileName = strTemplatePath;

            Object missing = System.Reflection.Missing.Value;
            Object oEmpty = "";
            Object oFalse = false;
            Object oTrue = true;
            Object oAutoFormat = word.WdOpenFormat.wdOpenFormatAuto;

            word.Application wApp = new word.Application();
            word.Document wDoc = wApp.Documents.Open(ref fileName,
                ref missing, ref missing, ref missing, ref missing, ref missing,
                ref missing, ref missing, ref missing, ref missing, ref missing,
                ref missing, ref missing, ref missing, ref missing, ref missing);
            word.MailMerge wMM = wDoc.MailMerge;

            wMM.OpenDataSource(strCSVPath, ref oAutoFormat, ref oTrue, ref oFalse, ref oTrue,
                                ref oFalse, ref oEmpty, ref oEmpty, ref oFalse, ref oEmpty, ref oEmpty,
                                ref oEmpty, ref oEmpty, ref oEmpty, ref missing, ref missing);

            wMM.DataSource.QueryString = "SELECT * FROM " + strCSVPath;

            wMM.Destination = word.WdMailMergeDestination.wdSendToNewDocument;


Write a mail : problem in SMTP server ?


Hai to all,

I want to sent and receive a mail to any maild id(based on user mind), now every time I need to give smtp server name of the sender mail in my code, but lot of smtp servers

available for different mail providers (we never assume what the mail user will give in to sender area), i have  a separate server with smtp and pop3 enabled,  I don't know how

to use this server for mail purpose.

If i use this server then will my problem is solved then how to use that server or any other solution ?


Members have any idea ?


SQL Agent Job Notification - Database Mail problem

I'm a little stumped. Have setup database mail on SQL Server 2008 (SP1 x64) and its working fine except when its supposed to send out a SQL Agent job notification.
I've enabled database mail on SQL Agent and have specified a profile, but when it tries to send an email on agent job completion it errors with "NOTE: Failed to notify '<operator>' via email."
Can anybody help?

Unicode problem from ashx to SQL Express


Hi everyone,

i have an sql express db with a table, containing a nvarchar(max) field.

If i add a text in SQL Management Studio, for example, running the query: UPDATE table SET htmlcontent=N'text with special character: SS' WHERE id = 1

everything is working fine!. The special unicode character S is saved into the field.

In ASP i have a generic handler which handles my data communication to and from the database. No matter what i try there, the S char is not accepted and

changed into a question mark. I have tried several things in SQL:

- stored proc with sp_executesql and parameters

- hardcoded query in the ashx file.. 

            sqlStr = "UPDATE ELEMENTS SET htmlcontent=N'" & myCleanResult & "' WHERE id=" & id

            connStringSQL = New SqlConnection(mySqlConnection)

            Dim myAdapter1 As New SqlCommand(sqlStr, connStringSQL)


            result = myAdapter1.ExecuteScalar()


Problem with Exporting RDLC to PDF while Using Unicode(Marathi)


I Have An RDLC Report in ASP.net 2.0  Application.and SQl Server2008

I have installed IndicaIME for Marathi for unicode.

When I export It in to PDF that will not display correct (Word In Marathi Format)  I USe Ariel Unicode Font
But it  will show some  extra character display with word

e.g Instead of displaying "Kishor" it will display "kshir" in marathi
What I have do ? For that just give link or code To export RDLC report in PDF ?

Mail Sending Problem in VB.net


            Dim mail As New MailMessage()           
            mail.From = New MailAddress(FromAddress)
            mail.Subject = subject
            mail.BodyEncoding = System.Text.Encoding.ASCII
            mail.Body = TheBody
            mail.IsBodyHtml = isHTML
            mail.Priority = MailPriority.High           
            Dim smt As New SmtpClient("HostName")
            smt.Credentials = New NetworkCredential("mailid", "password")           

I use the above Code for sending mail but I got the below error..

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

How to solve this issue...?

It is very urgent.....

Unicode (Marathi) Font problem in SSRS


I Have An RDLC Report in ASP.net 2.0  Application.

When I export It in to PDF that will not display correct (Word In Marathi Format) if I USe Ariel Unicode Font
it will show some  extra character display with word
What I have do ? For that just give link or code To export RDLC report in PDF ?

I also tried iTextsharp (Third party tool to generate PDF) but when it genrate PDF  marathi Characters are not displaying. It shows marathi as  blank space.



Hi All

i tried to make profile for mailing purpose in sqlserver 2005

EXECUTE msdb.dbo.sysmail_add_account_sp
    @account_name = 'test@test.com',
    @description = 'test',
    @email_address = 'test@test.com',
    @display_name = 'test',
    @mailserver_name = 'mail.test.com'

EXECUTE msdb.dbo.sysmail_add_profile_sp
       @profile_name = 'test Profile',
       @description = 'Profile used for Akruti club mail1'

EXECUTE msdb.dbo.sysmail_add_profileaccount_sp
    @profile_name = 'Akrui Club Profile',
    @account_name = 'test@test.com',
    @sequence_number = 1


EXECUTE msdb.dbo.sysmail_add_principalprofile_sp
    @profile_name = 'test Profile',

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend