I'm trying to send an email with XML in the body of the email, not as an attachment. I've used StringBuilder to build the body of the email as seen below. The problem is that the XML tags do not appear in the email, only the data.
Here is what I'm doing:
Code:
StringBuilder bodyBuilder = new StringBuilder();
bodyBuilder.Append("<?xml version=\"1.0\" encoding=\"utf-8\" ?>");
bodyBuilder.Append("<?ADF version \"1.0\"?>");
bodyBuilder.Append("<adf>");
bodyBuilder.Append("<prospect>");
bodyBuilder.Append("<RequestDate>" + personalInfo.CreatedOn.Value.ToString("MM/dd/yyyy"));
bodyBuilder.Append("</RequestDate>");
.
.
.
}
bodyBuilder.Append("</prospect>");
bodyBuilder.Append("</adf>");
}
string subject = "Lead from System";
EmailHelper.SendTEXTEmail(fromAddress, toAddress, subject, bodyBuilder.ToString());
Your help will be sincerely appreciated.