I assume you already have the data retrieved from the client in your razor page. So you just need to send an email. That is done using [SmtpClient](https://learn.microsoft.com/en- us/dotnet/api/system.net.mail.smtpclient?view=net-7.0).
var client = new SmtpClient();
var from = new MailAddress("******@somewhere.com");
var to = new MailAddress("******@somewhere.com");
var msg = new MailMessage(from, to);
msg.Subject = "Sending an email";
msg.Body = "Body of message";
client.Send(msg);
As for building the message you can use any approach you want depending on what you are trying to do. For a simple message just use a string. If you need to build a formatted message with some simple values then use string interpolation. If you need to format more complex messages then use StringBuilder
.
msg.Body = "Hello";
//More elaborate
var name = "Bob";
msg.Body = $"Hello {name}";
//Most complex
var builder = new StringBuilder();
builder.Append("Hello ");
if (isFemale)
builder.Append("Mrs ");
else
builder.Append("Mr ");
builder.Append(name);
builder.Append($"You owe us {amount:c}. Please remit");
msg.Body = builder.ToString();