Results 1 to 4 of 4

Thread: Create email with link to file

  1. #1

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    Driving a 2018 Mustang GT down Route 8
    Posts
    4,475

    Create email with link to file

    I have a web service that takes an XML string for input and saves the XML to a file. The filename is created from the date and time and a random number generator. The program also edits the XML as it processes, and there can be errors. When there's an error, I create an email which describes the error and then repeats the XML in the body of the email. I am using another web service written in-house to send the email.

    I want to include in the email a link to the filename I saved. What is the best way to do this? I think I need to use HTML, but there's an html flag I pass to the email web service which needs to be false. When it was true, the XML wasn't formatting.
    There are 10 kinds of people in this world. Those who understand binary, and those who don't.

  2. #2
    Addicted Member thetimmer's Avatar
    Join Date
    Jan 2014
    Location
    Plano, Texas
    Posts
    243

    Re: Create email with link to file

    If you're setting the email format to text ( HTML = false ) then you won't be able to have an html link in the body. Can you set it to true and reference a style sheet for your xml to format it within the html body?

    If you must leave the body as text how about attaching the file to the email?
    _____________
    Tim

    If anyone's answer has helped you, please show your appreciation by rating that answer.
    When you get a solution to your issue remember to mark the thread Resolved.


    reference links

  3. #3

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    Driving a 2018 Mustang GT down Route 8
    Posts
    4,475

    Re: Create email with link to file

    Thanks for the reply!

    Quote Originally Posted by thetimmer View Post
    ...Can you set it to true and reference a style sheet for your xml to format it within the html body?
    I have no idea... But thanks for the suggestion. I've already emailed my boss that they looked mutually exclusive so he may not want to go to great lengths. I will wait to see what he says.
    There are 10 kinds of people in this world. Those who understand binary, and those who don't.

  4. #4
    Member
    Join Date
    Apr 2010
    Posts
    43

    Re: Create email with link to file

    Not certain this will work, but it might be worth a try:

    You may be able to preserve the XML formatting by enclosing the XML text (with HTML=true) with the <pre> tag -- preformatted text. This will preserve the spaces in the xml, rather than removing them the way that HTML typically does. Then you can use the HTML e-mail and the link will work, and the XML will look right.

    http://www.w3schools.com/tags/tag_pre.asp

    Hope that helps!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width