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. Sending Email from Asp.net

Sending Email from Asp.net

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdatabasehelptutorial
9 Posts 4 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.
  • F Offline
    F Offline
    frossie
    wrote on last edited by
    #1

    Hi everyone. i have a query. Do anyone by chance know how to send a webform from asp.net to an email address? The webform itself consists of many textbox values and i do not want to just send a value across but retrieve multiple values from multiple textboxes and send it across to the user as an email. Please help me. Thanks in advance. frossie

    G S 2 Replies Last reply
    0
    • F frossie

      Hi everyone. i have a query. Do anyone by chance know how to send a webform from asp.net to an email address? The webform itself consists of many textbox values and i do not want to just send a value across but retrieve multiple values from multiple textboxes and send it across to the user as an email. Please help me. Thanks in advance. frossie

      G Offline
      G Offline
      g00fyman
      wrote on last edited by
      #2

      if the data is from a dataset or database, dump it to xml and apply an xsltranform to it then email the resulting html page. otherwise iterate all form controls and create a plain text or html document then email it. hope that helps, g00fy

      1 Reply Last reply
      0
      • F frossie

        Hi everyone. i have a query. Do anyone by chance know how to send a webform from asp.net to an email address? The webform itself consists of many textbox values and i do not want to just send a value across but retrieve multiple values from multiple textboxes and send it across to the user as an email. Please help me. Thanks in advance. frossie

        S Offline
        S Offline
        Sebastien Lachance
        wrote on last edited by
        #3

        You can build a string with all the information you want to send and use the System.Web.Mail namespace to send a mail containing the string ? My Blog

        F 1 Reply Last reply
        0
        • S Sebastien Lachance

          You can build a string with all the information you want to send and use the System.Web.Mail namespace to send a mail containing the string ? My Blog

          F Offline
          F Offline
          frossie
          wrote on last edited by
          #4

          Can u show me some sample codes to go about doing it? What can i put here, MailMessage.Body = ? How do i send all the multiple values from different textboxes to the body of an email? Currently, i have inserted a asp:panel in my webform with all the textboxes in it, how can i add the panel of stuff into the MailMessage.Body? frossie

          S 1 Reply Last reply
          0
          • F frossie

            Can u show me some sample codes to go about doing it? What can i put here, MailMessage.Body = ? How do i send all the multiple values from different textboxes to the body of an email? Currently, i have inserted a asp:panel in my webform with all the textboxes in it, how can i add the panel of stuff into the MailMessage.Body? frossie

            S Offline
            S Offline
            Sebastien Lachance
            wrote on last edited by
            #5

            You create something to hold the value. One way can be this : StringBuilder sb = new StringBuilder(); sb.Append(TextBox1.Text + ", " + TextBox2.Text); Then you put this into your MailMessage.Body property. Another way would be to get the Html of your panel and put it into your MailMessage.Body with the BodyFormat set to Html. My Blog -- modified at 9:19 Monday 10th July, 2006

            F 1 Reply Last reply
            0
            • S Sebastien Lachance

              You create something to hold the value. One way can be this : StringBuilder sb = new StringBuilder(); sb.Append(TextBox1.Text + ", " + TextBox2.Text); Then you put this into your MailMessage.Body property. Another way would be to get the Html of your panel and put it into your MailMessage.Body with the BodyFormat set to Html. My Blog -- modified at 9:19 Monday 10th July, 2006

              F Offline
              F Offline
              frossie
              wrote on last edited by
              #6

              Thanks for the above codes.:) But i would be more interested if you can further guide me on how to get the HTML of my panel to put it into my MailMessage.Body. By the way, i have already set the BodyFormat to HTML. If u can, please show me a sample code? Thanks in advance. frossie

              S R 2 Replies Last reply
              0
              • F frossie

                Thanks for the above codes.:) But i would be more interested if you can further guide me on how to get the HTML of my panel to put it into my MailMessage.Body. By the way, i have already set the BodyFormat to HTML. If u can, please show me a sample code? Thanks in advance. frossie

                S Offline
                S Offline
                Sebastien Lachance
                wrote on last edited by
                #7

                I would recommend you to look at this code snippet. This is the only way I'm aware of. Sorry. :doh: http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet.webcontrols/browse_thread/thread/89d4acb1b5675de9/4abea7433cd21e2d?lnk=st&q=Get+the+InnerHtml+of+a+Panel+ASP.NET&rnum=1&hl=en#4abea7433cd21e2d[^] My Blog

                1 Reply Last reply
                0
                • F frossie

                  Thanks for the above codes.:) But i would be more interested if you can further guide me on how to get the HTML of my panel to put it into my MailMessage.Body. By the way, i have already set the BodyFormat to HTML. If u can, please show me a sample code? Thanks in advance. frossie

                  R Offline
                  R Offline
                  RichardGrimmer
                  wrote on last edited by
                  #8

                  Try: message.Body = Panel.InnerHTML "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox

                  F 1 Reply Last reply
                  0
                  • R RichardGrimmer

                    Try: message.Body = Panel.InnerHTML "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox

                    F Offline
                    F Offline
                    frossie
                    wrote on last edited by
                    #9

                    there will be an error if i put that sentence. Cos it say that InnerHTML is not part of a panel control. sigh. frossie

                    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