Creating HTML email from webform

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peter Cresswell

    #1

    Creating HTML email from webform

    Hi chaps!

    I need to creat a confirmation email for an online shopping site. The email
    needs to be in HTML and would have a lot of dynamic content in it relative
    to the order that's just been placed.

    I figured the easiest way to do this would be to create a webform that
    recieves a URL parameter that contains the orderID, then builds the page and
    populates it with the relevant info. Then I should just be able to rip out
    the response to this web request into a string, right?

    Well as far as I can see it's not that simple. I've spent the last day
    playing about with streams from HttpWebResponse objects etc.... and haven't
    got very far.

    Has anybody else been able to do this? How do most people create dynamic
    HTML emails?

    Thanks in advance,

    p-cresswell


  • Noah Coad [MVP .NET/C#]

    #2
    Re: Creating HTML email from webform

    Have you checked out System.Web.Mail .MailMessage?

    -Noah Coad
    Microsoft MVP & MCP [.NET/C#]

    "Peter Cresswell" <p-cresswell@iname .com> wrote in message
    news:uw7d6KgUDH A.2364@TK2MSFTN GP09.phx.gbl...[color=blue]
    > Hi chaps!
    >
    > I need to creat a confirmation email for an online shopping site. The[/color]
    email[color=blue]
    > needs to be in HTML and would have a lot of dynamic content in it relative
    > to the order that's just been placed.
    >
    > I figured the easiest way to do this would be to create a webform that
    > recieves a URL parameter that contains the orderID, then builds the page[/color]
    and[color=blue]
    > populates it with the relevant info. Then I should just be able to rip out
    > the response to this web request into a string, right?
    >
    > Well as far as I can see it's not that simple. I've spent the last day
    > playing about with streams from HttpWebResponse objects etc.... and[/color]
    haven't[color=blue]
    > got very far.
    >
    > Has anybody else been able to do this? How do most people create dynamic
    > HTML emails?
    >
    > Thanks in advance,
    >
    > p-cresswell
    >
    >[/color]


    Comment

    • Peter Cresswell

      #3
      Re: Creating HTML email from webform



      Yes I have been looking at that class and can send emails with it. But I
      really want some code that will "screen scrape" the html out of a web
      response, and then put it in a string so I can add it to myMail.Body.

      Do you know how to do this?

      So just to clarify...

      I want the code to request -

      And i want to put the html response from that request into a string.

      Thanks again,

      p-cresswell

      *** Sent via Developersdex http://www.developersdex.com ***
      Don't just participate in USENET...get rewarded for it!

      Comment

      • Peter Cresswell

        #4
        Re: Creating HTML email from webform

        I've found this article on CodeProject which tells me exactly what I needed
        to know. The code looks a lot like what I had tried, the difference being
        his works, mine didn't :-)


        A big thank you to the author - Mark Nischalke

        p-cresswell

        "Peter Cresswell" <p-cresswell@iname .com> wrote in message
        news:eH2eIfiUDH A.2052@TK2MSFTN GP10.phx.gbl...[color=blue]
        >
        >
        > Yes I have been looking at that class and can send emails with it. But I
        > really want some code that will "screen scrape" the html out of a web
        > response, and then put it in a string so I can add it to myMail.Body.
        >
        > Do you know how to do this?
        >
        > So just to clarify...
        >
        > I want the code to request -
        > http://localhost/confimationEmail.aspx?OrderID=10
        > And i want to put the html response from that request into a string.
        >
        > Thanks again,
        >
        > p-cresswell
        >
        > *** Sent via Developersdex http://www.developersdex.com ***
        > Don't just participate in USENET...get rewarded for it![/color]


        Comment

        Working...