send email from form with dynamic data

  • Thread starter Thread starter nicholas
  • Start date Start date
N

nicholas

I have a shopping cart on an aspx page.
Let's say the buyer bought 2 products.
The buyer sees 2 products he bought and also has to fill in his personal
data in a webform.

When he submits the form, an e-mail should be sent with all the products he
bought and his personal data.

Transmitting his personal data is no problem, but how can I get the products
he bought in the mail.

This is dynamic data. It could be 1, 2 or more products...

All help is welcome !

THX
Nicholas.
 
nicholas said:
I have a shopping cart on an aspx page.
Let's say the buyer bought 2 products.
The buyer sees 2 products he bought and also has to fill in his personal
data in a webform.

When he submits the form, an e-mail should be sent with all the products he
bought and his personal data.

Transmitting his personal data is no problem, but how can I get the products
he bought in the mail.

This is dynamic data. It could be 1, 2 or more products...

Pull the products info into a DataReader, loop through, appending to the
email on each pass. Shouldn't matter how many products using this method.
 
I don't realy understand.
Usualy, the mail components need you to fill in a "mailbody"-tag in which
you can insert html.

So what do you mean by appendding the data to the mail.

THX a lot for your help,
Nicholas
 
nicholas said:
I don't realy understand.
Usualy, the mail components need you to fill in a "mailbody"-tag in which
you can insert html.

So what do you mean by appendding the data to the mail.

Nicholas: Look at how you contruct the mail body with just personal data.
You understand that, correct?

The principle is still the same with adding the products, too.

This is a very rough example, you would have to do your formatting the way
you want it:

while ( dataReader.Read() ) {
mailBody += dataReader["productId"] + " " + dataReader["productName"] +
"\n";
}
 
Back
Top