XLM in body of email

This is a discussion on XLM in body of email within the C# Programming forums, part of the General Programming Boards category; I'm trying to send an email with XML in the body of the email, not as an attachment. I've used ...

  1. #1
    Registered User
    Join Date
    Jul 2011
    Posts
    4

    XLM in body of email

    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.

  2. #2
    Registered User manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Kolkata@India
    Posts
    2,499
    The problem is that the XML tags do not appear in the email, only the data.
    Are you surely checking the plaintext version of the mail?

    i.e..with any sort of formatting disabled..
    Last edited by manasij7479; 07-07-2011 at 07:37 AM.
    Manasij Mukherjee | gcc-4.8.2 @Arch Linux
    Slow and Steady wins the race... if and only if :
    1.None of the other participants are fast and steady.
    2.The fast and unsteady suddenly falls asleep while running !



  3. #3
    Registered User
    Join Date
    Jul 2011
    Posts
    4
    Yep. Plain text. Data only, no XML tags.

  4. #4
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,139
    What does EmailHelper.SendTEXTEmail do?
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  5. #5
    Registered User
    Join Date
    Jul 2011
    Posts
    4
    Quote Originally Posted by nvoigt View Post
    What does EmailHelper.SendTEXTEmail do?
    It is supposed to send the email as plain text email as opposed to the SendHTMLEmail

  6. #6
    Registered User
    Join Date
    Jul 2011
    Posts
    4
    Quote Originally Posted by dcwood57 View Post
    It is supposed to send the email as plain text email as opposed to the SendHTMLEmail
    Upon further review, EmailHelper actually seems to strip out all formatting. Found the source of the problem. Now I am struggling with sending an XML formatted email from C# dot net nuke.

  7. #7
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,171
    Why not just use System.Net.Mail Namespace ()?
    If you understand what you're doing, you're not learning anything.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Does any body use Z ?
    By jabka in forum C Programming
    Replies: 5
    Last Post: 10-19-2007, 03:23 PM
  2. Any body know....
    By swgh in forum Game Programming
    Replies: 1
    Last Post: 01-25-2006, 05:41 AM
  3. Where is the body
    By siavoshkc in forum C++ Programming
    Replies: 11
    Last Post: 01-19-2006, 04:52 AM
  4. can some body help
    By mona in forum Game Programming
    Replies: 5
    Last Post: 11-12-2002, 04:58 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21