Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Emailing a dynamically generated aspx page

Reply
Thread Tools

Emailing a dynamically generated aspx page

 
 
Gary Coutts
Guest
Posts: n/a
 
      04-20-2006
Hi,

After dynamically generating an aspx page I need to email what is being
displayed by the browser.

I have looked at System.Web.Mail but it looks like you have to generate the
body of the message as one long string.

Can anyone point me in the right direction.

I am using VS2003 ASP 1.1.


Cheers

Gary Coutts


 
Reply With Quote
 
 
 
 
q
Guest
Posts: n/a
 
      04-20-2006
Here's a sample... pay close attention to the Render method.

public bool SendEmail {
get { return sendEmail; }
set { sendEmail = value; }
}

void btnConfirm_Click(object sender, EventArgs e) {
try {
OrderHeaderEntity header = new OrderHeaderEntity(new
Guid(this.OrderId));
header.OrderSent = true;
header.Save( );

this.SendEmail = true;
}
catch (Exception ex) {
lblErrorMessage.Text = ex.Message;
}
}

protected override void Render(HtmlTextWriter writer) {
StringBuilder builder = new StringBuilder();
HtmlTextWriter htmlTextWriter = new HtmlTextWriter(new
StringWriter(builder));
base.Render(htmlTextWriter);
string output = builder.ToString();
writer.Write(output);
if (this.SendEmail) {
this.SendEmail = false;
SendEmail(output);
}
}

 
Reply With Quote
 
 
 
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      04-20-2006
You can email a page by using the WebRequest and MailMessage classes.

Here are a couple examples:
http://www.aspalliance.com/stevesmit...ailwebsite.asp
http://aspnet.4guysfromrolla.com/articles/091102-1.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net


"Gary Coutts" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi,
>
> After dynamically generating an aspx page I need to email what is being
> displayed by the browser.
>
> I have looked at System.Web.Mail but it looks like you have to generate
> the body of the message as one long string.
>
> Can anyone point me in the right direction.
>
> I am using VS2003 ASP 1.1.
>
>
> Cheers
>
> Gary Coutts
>



 
Reply With Quote
 
Gary Coutts
Guest
Posts: n/a
 
      04-23-2006
Thanks Steve,

The articles were most helpful.

Cheers

Gary

"Steve C. Orr [MVP, MCSD]" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> You can email a page by using the WebRequest and MailMessage classes.
>
> Here are a couple examples:
> http://www.aspalliance.com/stevesmit...ailwebsite.asp
> http://aspnet.4guysfromrolla.com/articles/091102-1.aspx
>
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://SteveOrr.net
>
>
> "Gary Coutts" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> Hi,
>>
>> After dynamically generating an aspx page I need to email what is being
>> displayed by the browser.
>>
>> I have looked at System.Web.Mail but it looks like you have to generate
>> the body of the message as one long string.
>>
>> Can anyone point me in the right direction.
>>
>> I am using VS2003 ASP 1.1.
>>
>>
>> Cheers
>>
>> Gary Coutts
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamically add aspx snippet into a given aspx page ColdAir ASP .Net 1 02-26-2009 12:49 AM
Loading an aspx page in a fram from another aspx page =?Utf-8?B?Uk1M?= ASP .Net 1 09-16-2005 01:21 PM
adding main.aspx.vb & main.aspx.resx under aspx John M ASP .Net 1 05-29-2005 09:27 PM
How to Pass values between from a popup page aspx & a normal page aspx Marco Antonio Montalvo Durán ASP .Net 2 01-23-2004 09:35 PM
How do I post data from aspx page to another aspx page. Sriram Mallajyosula ASP .Net 1 11-05-2003 04:48 PM



Advertisments