Link to home
Start Free TrialLog in
Avatar of KaiserSose
KaiserSose

asked on

Send an aspx page as MailMessage.Body

I have sent mail many times so I know how to construct the MailMessage and send it.  I want to email a very detailed report of stuff pulled from a database. I want to have page A have a textbox and button where you enter the users email and click go.   Piece of cake right?  Well, I'd like to avoid having one giant body string that I have to append 500 small strings and variables together to create.

I would love it if it is possible to do something like:

SmtpMail.body = pageb.aspx

The page would be fully working if you navigate to it, and do all the necessary information calculation.  Is this even possible?  

Thanks for looking

dave
Avatar of Razzie_
Razzie_

What does page b contain? I mean, do you want everything including page b's html code? does it contain the stuff from the database and do you want to send that? If so, what kind of data are we talking about? Is it xml, html, simple strings, etc.

Regards,

Razzie
SOLUTION
Avatar of 123654789987
123654789987

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of KaiserSose

ASKER

An attachment wouldn't be too bad, but I don't think sending an aspx page is the best file format.  Actually, now that you mention it, an attachment might be the best way to go. Is this still possible?   What I want is an html formatted report.  So it would basically be exactly like you navigated to  whatever.com/pageb.aspx, but it would probably have to be sent as .html and not .aspx because the user will absolutely not have connectivity to the db.   Page b contains a bunch of code behind stuff that pulls many values from a db and formats the report.

Thanks for the help

dave
Oh,  page b doesn't have any super complex values, just alot of billing data.  The report would basically just be tables with headers and values.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I decided not to send the report by email, the people reading the report preferred to see it online.  Thank you both for helping.

dave