I have a problem here as I am trying to send an email to the user of my website bearing the order details. Email would show a list of items that the user has actually ordered. I use a foreach loop on web pages that display the list of items. Whenever I am trying to do this within my postmark email message its giving me an error: "Invalid expression term 'foreach'". Can someone come to my help
code:
//database query
PostmarkMessage cmessage = new PostmarkMessage
{
From = "server@server.co.uk",
To = "user@user.co.uk",
Subject = "Thank you! " + ordernumber,
HtmlBody = "
Your Order:" + ordernumber + "
" +
foreach (var o in order)//error here
{
@o.to_ChooseCanvasSize
£@o.to_Price
@o.to_Amount
£@o.to_ItemTotalPrice
}
"end!",
};
Doing it in C# and ASP.NET Web Pages. Rgds.
49 weeks 4 days ago