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. asp.net 1.1 mailmessage

asp.net 1.1 mailmessage

Scheduled Pinned Locked Moved ASP.NET
csharphtmlasp-netsales
6 Posts 3 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.
  • A Offline
    A Offline
    Arkett
    wrote on last edited by
    #1

    I have created a form that collects some information then builds that information using a stringbuilder into an html table and finally sends that to a sales desk via system.web.mail everything works as expected except the html portion of the recieved email has been truncated to 1022 characters. The plain text portion of the recieved email contains all of the information. I have looked all over msdn for any indication of size limitations or max size properties and found nothing. Does anyone have any idea what might be causeing this to happen. End of Line.

    S A 2 Replies Last reply
    0
    • A Arkett

      I have created a form that collects some information then builds that information using a stringbuilder into an html table and finally sends that to a sales desk via system.web.mail everything works as expected except the html portion of the recieved email has been truncated to 1022 characters. The plain text portion of the recieved email contains all of the information. I have looked all over msdn for any indication of size limitations or max size properties and found nothing. Does anyone have any idea what might be causeing this to happen. End of Line.

      S Offline
      S Offline
      Shiby
      wrote on last edited by
      #2

      Can you please show your code. Let me look at it and get back to you. In my previous application I did the same way, it works. Regards, Shiby

      A 1 Reply Last reply
      0
      • S Shiby

        Can you please show your code. Let me look at it and get back to you. In my previous application I did the same way, it works. Regards, Shiby

        A Offline
        A Offline
        Arkett
        wrote on last edited by
        #3

        Here's the code as requested: Private Sub SendEmail(mailTo) Dim MsgTxt as StringBuilder = New StringBuilder() MsgTxt.EnsureCapacity(1500) MsgTxt.append("Purchaser Information Form TURBO mail ========== ") MsgTxt.append(" ### Purchaser Information Form ") MsgTxt.append(" Source ") MsgTxt.append(Textbox1.text) MsgTxt.append(" Property Ref. No. ") MsgTxt.append(Textbox2.text) MsgTxt.append(" Family Name ") MsgTxt.append(Textbox3.text) MsgTxt.append(" Fore Name ") MsgTxt.append(Textbox4.text) MsgTxt.append(" Wife's Maiden Name ") MsgTxt.append(Textbox5.text) MsgTxt.append(" Wife's Fore Name ") MsgTxt.append(Textbox6.text) MsgTxt.append(" Postal Address ") MsgTxt.append(Textbox7.text) MsgTxt.append(" Town/City ") MsgTxt.append(Textbox8.text) MsgTxt.append(" County/Region ") MsgTxt.append(Textbox9.text) MsgTxt.append(" Country ") MsgTxt.append(Textbox10.text) MsgTxt.append(" Post Code ") MsgTxt.append(Textbox11.text) MsgTxt.append("    ") MsgTxt.append(" Home Telephone ") MsgTxt.append(Textbox12.text) MsgTxt.append(" Work Telephone ") MsgTxt.append(Textbox13.text) MsgTxt.append(" Mobile Telephone ") MsgTxt.append(Textbox14.text) MsgTxt.append(" Email Address ") MsgTxt.append(Textbox15.text) MsgTxt.append(" Occupation ") MsgTxt.append(Textbox16.text) MsgTxt.append(" Occupation (Spouse) ") MsgTxt.append(Textbox17.text) MsgTxt.append(" Date of Birth ") MsgTxt.append(Textbox18.text) MsgTxt.append(" Date of Birth (Spouse) ") MsgTxt.append(Textbox19.text) MsgTxt.append(" Place of Birth ") MsgTxt.append(Textbox20.text) MsgTxt.append(" Place of Birth (Spouse ") MsgTxt.append(Textbox21.text) MsgTxt.append(" Married Where ") MsgTxt.append(Textbox22.text) MsgTxt.append(" Married When ") MsgTxt.append(Textbox23.text

        I S 2 Replies Last reply
        0
        • A Arkett

          Here's the code as requested: Private Sub SendEmail(mailTo) Dim MsgTxt as StringBuilder = New StringBuilder() MsgTxt.EnsureCapacity(1500) MsgTxt.append("Purchaser Information Form TURBO mail ========== ") MsgTxt.append(" ### Purchaser Information Form ") MsgTxt.append(" Source ") MsgTxt.append(Textbox1.text) MsgTxt.append(" Property Ref. No. ") MsgTxt.append(Textbox2.text) MsgTxt.append(" Family Name ") MsgTxt.append(Textbox3.text) MsgTxt.append(" Fore Name ") MsgTxt.append(Textbox4.text) MsgTxt.append(" Wife's Maiden Name ") MsgTxt.append(Textbox5.text) MsgTxt.append(" Wife's Fore Name ") MsgTxt.append(Textbox6.text) MsgTxt.append(" Postal Address ") MsgTxt.append(Textbox7.text) MsgTxt.append(" Town/City ") MsgTxt.append(Textbox8.text) MsgTxt.append(" County/Region ") MsgTxt.append(Textbox9.text) MsgTxt.append(" Country ") MsgTxt.append(Textbox10.text) MsgTxt.append(" Post Code ") MsgTxt.append(Textbox11.text) MsgTxt.append("    ") MsgTxt.append(" Home Telephone ") MsgTxt.append(Textbox12.text) MsgTxt.append(" Work Telephone ") MsgTxt.append(Textbox13.text) MsgTxt.append(" Mobile Telephone ") MsgTxt.append(Textbox14.text) MsgTxt.append(" Email Address ") MsgTxt.append(Textbox15.text) MsgTxt.append(" Occupation ") MsgTxt.append(Textbox16.text) MsgTxt.append(" Occupation (Spouse) ") MsgTxt.append(Textbox17.text) MsgTxt.append(" Date of Birth ") MsgTxt.append(Textbox18.text) MsgTxt.append(" Date of Birth (Spouse) ") MsgTxt.append(Textbox19.text) MsgTxt.append(" Place of Birth ") MsgTxt.append(Textbox20.text) MsgTxt.append(" Place of Birth (Spouse ") MsgTxt.append(Textbox21.text) MsgTxt.append(" Married Where ") MsgTxt.append(Textbox22.text) MsgTxt.append(" Married When ") MsgTxt.append(Textbox23.text

          I Offline
          I Offline
          Ista
          wrote on last edited by
          #4

          so most definitly use the html text writer. it will be more organized Create subroutines to handle the small tasks and it wont be so hard. For instance, your checkbox rows call a subroutine like so CreateCheckBoxRow( string ID, string text, book checked) { ... } this code creates a table with a cellspacing attribute System.IO.StreamWriter sw = new System.IO.StreamWriter(@"C:\Table.txt"); System.Web.UI.HtmlTextWriter ht = new System.Web.UI.HtmlTextWriter( sw ); ht.WriteBeginTag("TABLE"); ht.WriteAttribute("cellspacing", "2", true); ht.Write(System.Web.UI.HtmlTextWriter.TagRightChar); ht.WriteFullBeginTag("TR"); ht.WriteBeginTag("TD"); ht.Write(System.Web.UI.HtmlTextWriter.TagRightChar); ht.WriteEndTag("TD"); ht.WriteEndTag("TR"); ht.WriteEndTag("TABLE"); ht.Close(); 1 line of code equals many bugs. So don't write any!!

          1 Reply Last reply
          0
          • A Arkett

            Here's the code as requested: Private Sub SendEmail(mailTo) Dim MsgTxt as StringBuilder = New StringBuilder() MsgTxt.EnsureCapacity(1500) MsgTxt.append("Purchaser Information Form TURBO mail ========== ") MsgTxt.append(" ### Purchaser Information Form ") MsgTxt.append(" Source ") MsgTxt.append(Textbox1.text) MsgTxt.append(" Property Ref. No. ") MsgTxt.append(Textbox2.text) MsgTxt.append(" Family Name ") MsgTxt.append(Textbox3.text) MsgTxt.append(" Fore Name ") MsgTxt.append(Textbox4.text) MsgTxt.append(" Wife's Maiden Name ") MsgTxt.append(Textbox5.text) MsgTxt.append(" Wife's Fore Name ") MsgTxt.append(Textbox6.text) MsgTxt.append(" Postal Address ") MsgTxt.append(Textbox7.text) MsgTxt.append(" Town/City ") MsgTxt.append(Textbox8.text) MsgTxt.append(" County/Region ") MsgTxt.append(Textbox9.text) MsgTxt.append(" Country ") MsgTxt.append(Textbox10.text) MsgTxt.append(" Post Code ") MsgTxt.append(Textbox11.text) MsgTxt.append("    ") MsgTxt.append(" Home Telephone ") MsgTxt.append(Textbox12.text) MsgTxt.append(" Work Telephone ") MsgTxt.append(Textbox13.text) MsgTxt.append(" Mobile Telephone ") MsgTxt.append(Textbox14.text) MsgTxt.append(" Email Address ") MsgTxt.append(Textbox15.text) MsgTxt.append(" Occupation ") MsgTxt.append(Textbox16.text) MsgTxt.append(" Occupation (Spouse) ") MsgTxt.append(Textbox17.text) MsgTxt.append(" Date of Birth ") MsgTxt.append(Textbox18.text) MsgTxt.append(" Date of Birth (Spouse) ") MsgTxt.append(Textbox19.text) MsgTxt.append(" Place of Birth ") MsgTxt.append(Textbox20.text) MsgTxt.append(" Place of Birth (Spouse ") MsgTxt.append(Textbox21.text) MsgTxt.append(" Married Where ") MsgTxt.append(Textbox22.text) MsgTxt.append(" Married When ") MsgTxt.append(Textbox23.text

            S Offline
            S Offline
            Shiby
            wrote on last edited by
            #5

            When you are creating an object of StringBuilder, please don't need to specify following statement MsgTxt.EnsureCapacity(1500) Remove this statement "MsgTxt.EnsureCapacity(1500)" and try out, it will work. :) Please do let me know if you are facing any problem. Regards, Shiby

            1 Reply Last reply
            0
            • A Arkett

              I have created a form that collects some information then builds that information using a stringbuilder into an html table and finally sends that to a sales desk via system.web.mail everything works as expected except the html portion of the recieved email has been truncated to 1022 characters. The plain text portion of the recieved email contains all of the information. I have looked all over msdn for any indication of size limitations or max size properties and found nothing. Does anyone have any idea what might be causeing this to happen. End of Line.

              A Offline
              A Offline
              Arkett
              wrote on last edited by
              #6

              Shiby you're talking nonsense, there is nothing wrong with the content of the stringbuilder, it contains all the information. Ista your point may or may not be valid, but it still doesn't explain why the resultant email only contains the first 1022 characters of the html message portion and the entire message in the plain text portion. End of Line.

              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