Hi Vasanth,
Did the code that I send to you didn't work for you? This is how it is working.
- I have an email template with placholder values in the Email templates directory. I will paste the email template below.
- The field values in the Template and the object should match for it to replace.
- You will create an object in your .NET code and call the right template in which you want to replace those values along with object.
- SendEmailWithTemplate method will populate values in the template and will send email
Template Code under Email templates
<div>Hello, {%FirstName%} {%LastName%}</div>
<div>{%EmailAddress%}</div>
After fetching data froma form like Brenden suggested you may call this code to call MacroResolver
// Send Email
MacroResolver mcr = new MacroResolver();
// You need to fetch first_name & last_name using Brenden's code.
mcr.SetNamedSourceData("FirstName", first_name);
mcr.SetNamedSourceData("LastName", last_name);
mcr.SetNamedSourceData("EmailAddress", email_id);
// Call SendEmail method that I provided above using Email template name. Lets
// Say its name is "EmailToSend"
// EmailAddress is the emaill address to which you want to send email. Should
// be fetched dynamically
SendEmail("EmailToSend", mcr, EmailAddress);
I hope this helps.
Thanks,
Chetan