Creating HTML email from webform

  • Thread starter Thread starter Peter Cresswell
  • Start date Start date
P

Peter Cresswell

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
 
Have you checked out System.Web.Mail.MailMessage?

-Noah Coad
Microsoft MVP & MCP [.NET/C#]
 
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
 
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
 
Back
Top