You must Sign In to post a response.
  • Category: ASP.NET

    Ajax HTML editor Issue In Asp.Net

    I am using Ajax html editor in my application.
    I am creating HTML from C# and passing to editor control. Then in editor, there is button to send email.
    On click, email with html editor content send to customer.
    The problem is, email design is not same as html string created initially.

    Ex. If I am passing string as, <div><p style='font-size: 14px;font-family: calibri;font-style: normal;color: #333333;'>Dear Team</p></div>

    On email sending, the string return from html editor as,
    Dear Team<br />
    <br />

    I want to send original string as it is in email.
    How to achieve this. ?
  • #770380
    Hi Pranjal,

    i hope you are using BodyHtml to assign the message body while you assigning the mail content like in your case above HTML. if you assign with BodyHtml then it will render the html string to your expected body message and avoid the html tags.

    here is example

    message. Subject = "Sending Email with HTML Body";
    string htmlString = @"<html>
    <p>Dear Team,</p>
    <p>Thank you for your letter of yesterday inviting me to come for an Dinner party.
    I shall be happy to be there as requested and will be part of that.</p>
    <p>Sincerely,<br>-Ramana Reddy</br></p>
    </html> ";

    message.BodyHtml = htmlString;

    B.Ramana Reddy

  • Sign In to post your comments