how to send radeditor boldtext and forecolor through SMTP

6 posts, 0 answers
  1. Saimadhukar
    Saimadhukar avatar
    31 posts
    Member since:
    Sep 2011

    Posted 11 Nov 2011 Link to this post

    Hi,
    i have been using radeditor for email application as body for sending text ,if we send bold text or text with forecolours  through smtp to other mails like gmail e.t.c the text we are sending in bold or with forecolour are displayed as simple text without colour  ,how to solve this any idea i amsending smtp code please respond,thanks.

    try
           {
               DbLayer objDB = new DbLayer();
               System.Net.Mail.MailMessage Message = new System.Net.Mail.MailMessage();           
               Message.To.Add(rdtxtTo.Text);
               if (rdtxtCC.Text != string.Empty)
               {
                   Message.CC.Add(rdtxtCC.Text);
               }
               if (rdtxtBcc.Text != string.Empty)
               {
                   Message.Bcc.Add(rdtxtBcc.Text);
               }
               Message.Subject = rdtxtSubject.Text;
             //Discalimercode
               CreateEventEntities objentity = new CreateEventEntities();
             
               var mailDisclaimers = from c in objentity.Disclaimers where c.DisclaimerID == 1 select c;
               if (mailDisclaimers.ToList().Count > 0 && mailDisclaimers.ToList()[0].DisclaimerID != 0)
               {
                   if (mailDisclaimers.ToList()[0].DisclaimerText.ToString().Length > 0)
                       Disctext = mailDisclaimers.ToList()[0].DisclaimerText.ToString();
                   Disctext = "<br/><br/><br/><br/><br/>" + Disctext;
               }
               rdeditortxt.Content =  rdeditortxt.Content + Disctext;
                 
                  Message.Body =  rdeditortxt.Text;
               System.Net.Mail.SmtpClient SmtpClient = new System.Net.Mail.SmtpClient("smtp.gmail.com", 587);
               SmtpClient.EnableSsl = true;
               SmtpClient.Credentials = new System.Net.NetworkCredential("abc.com", "abc");
               System.Net.Mail.MailAddress FromEmail = new System.Net.Mail.MailAddress(TextBox1.Text);
               Message.From = FromEmail;
                  SmtpClient.Send(Message);
  2. Rumen
    Admin
    Rumen avatar
    14459 posts

    Posted 11 Nov 2011 Link to this post

    Hi Saimadhukar,

    My suggestion is to enable the ConvertInlineStylesToAttributes content filter which converts XHTML compliant inline style attributes to Email compliant element attribut. This filter is improved and the fixes will appear in  the Q3 2011 release which is scheduled for the middle of next week.

    Best regards,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  3. Saimadhukar
    Saimadhukar avatar
    31 posts
    Member since:
    Sep 2011

    Posted 18 Nov 2011 Link to this post

    Hello Rumen,

    thanks for response can we use inlinestyles to attributes we have in present version .

  4. Saimadhukar
    Saimadhukar avatar
    31 posts
    Member since:
    Sep 2011

    Posted 18 Nov 2011 Link to this post


    hello,
     i have used the Convert inline style to attributes filter but its not working ,the bold and underlined content are appearing as simple text in webbrowsers when we sent mail through smtp to gmail or e.t.c . 
  5. Rumen
    Admin
    Rumen avatar
    14459 posts

    Posted 18 Nov 2011 Link to this post

    Hello Saimadhukar,

    Please tell us which tags do you expect to be produced for bold and underlined content by RadEditor so that we can provide a solution?

    Best regards,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  6. Saimadhukar
    Saimadhukar avatar
    31 posts
    Member since:
    Sep 2011

    Posted 21 Nov 2011 Link to this post

    Hello Rumen ,

    actually the problem is solved  by adding the Html tags between radeditor content,i am sending the below code for reference ,thank u for ur support.

    Regards,
    Madhukar.
    rdtxtBody.Content =  rdtxtBody.Content + Disctext;
                
                
               Message.IsBodyHtml = true;
               
               Message.Body = "<Html><Body>"+ rdtxtBody.Content + "</Body> </Html>";
Back to Top