Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to apply stylesheet class in EMail HTML format

How to apply stylesheet class in EMail HTML format

Scheduled Pinned Locked Moved ASP.NET
htmltutorialquestion
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Deepml
    wrote on last edited by
    #1

    I want to apply stylesheet to the HTML format of mail. I dont want to use code like : string strBody=""; strBody += "

    Hi,"; strBody += "

    "; Instead of that want to use : string strBody=""; strBody += "

    Hi,"; strBody += "

    "; ObjMail.BodyFormat=MailFormat.Html; ObjMail.Body=strBody; Is it possible to use what I expected??

    A 1 Reply Last reply
    0
    • D Deepml

      I want to apply stylesheet to the HTML format of mail. I dont want to use code like : string strBody=""; strBody += "

      Hi,"; strBody += "

      "; Instead of that want to use : string strBody=""; strBody += "

      Hi,"; strBody += "

      "; ObjMail.BodyFormat=MailFormat.Html; ObjMail.Body=strBody; Is it possible to use what I expected??

      A Offline
      A Offline
      Abhijit Jana
      wrote on last edited by
      #2

      Deepml wrote:

      Instead of that want to use : string strBody=""; strBody += "

      Hi,"; strBody += "

      "; ObjMail.BodyFormat=MailFormat.Html; ObjMail.Body=strBody;

      Did you check it? How it will get class='verdanaText' . You have to write the cssclass also with the BodyString.

      cheers, Abhijit CodeProject MVP

      D 1 Reply Last reply
      0
      • A Abhijit Jana

        Deepml wrote:

        Instead of that want to use : string strBody=""; strBody += "

        Hi,"; strBody += "

        "; ObjMail.BodyFormat=MailFormat.Html; ObjMail.Body=strBody;

        Did you check it? How it will get class='verdanaText' . You have to write the cssclass also with the BodyString.

        cheers, Abhijit CodeProject MVP

        D Offline
        D Offline
        Deepml
        wrote on last edited by
        #3

        Abhijit Can you please tell me how to write that cssClass with Bodystring,I mean how to write

        A 1 Reply Last reply
        0
        • D Deepml

          Abhijit Can you please tell me how to write that cssClass with Bodystring,I mean how to write

          A Offline
          A Offline
          Abhijit Jana
          wrote on last edited by
          #4

          Deepml wrote:

          mean how to write

          Not, its not like that. I want to mean, Create a mail content file like .FontHeaderStyle { font-size: 12px; font-family: verdana; color:#C41230; }

          This is Sample HTML Mail

          Now, read the content as Text Reader and put it in mail body. Hope this is not clear to any. Any doubts ? cheers, Abhijit CodeProject MVP

          D 1 Reply Last reply
          0
          • A Abhijit Jana

            Deepml wrote:

            mean how to write

            Not, its not like that. I want to mean, Create a mail content file like .FontHeaderStyle { font-size: 12px; font-family: verdana; color:#C41230; }

            This is Sample HTML Mail

            Now, read the content as Text Reader and put it in mail body. Hope this is not clear to any. Any doubts ? cheers, Abhijit CodeProject MVP

            D Offline
            D Offline
            Deepml
            wrote on last edited by
            #5

            Thanks Abhijit.. I got it :)

            A 1 Reply Last reply
            0
            • D Deepml

              Thanks Abhijit.. I got it :)

              A Offline
              A Offline
              Abhijit Jana
              wrote on last edited by
              #6

              Go ahead. :thumbsup:

              cheers, Abhijit CodeProject MVP

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups