Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. reposted: attach an excel fiel to an email

reposted: attach an excel fiel to an email

Scheduled Pinned Locked Moved C#
sysadmin
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    michael_jhons
    wrote on last edited by
    #1

    hello everybody, i have a datatable wich i want it to be attached in an email as excel(.xls) in order to do that: 1. i'm exporting the datatable into an excel file. 2. i'm saving it in a specific folder. 3. i'm attaching it. is there any way to directly attach the datatable to an email as excel file directly without exporting and saving or at lest not saving because it's working on a server an i don't want to use its space kind regards

    M 1 Reply Last reply
    0
    • M michael_jhons

      hello everybody, i have a datatable wich i want it to be attached in an email as excel(.xls) in order to do that: 1. i'm exporting the datatable into an excel file. 2. i'm saving it in a specific folder. 3. i'm attaching it. is there any way to directly attach the datatable to an email as excel file directly without exporting and saving or at lest not saving because it's working on a server an i don't want to use its space kind regards

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      michael_jhons wrote:

      is there any way to directly attach the datatable to an email

      Not that I can think of. An attachment has to be a physical file rather than an abstraction in memory, unless you write the data into the body of the email (rather a silly solution actually). Why not clean up the attachment file after it has been sent? You could even clean out the attachment folder prior to sending the next email or have a job that periodically cleans the attachments, there are many options here.

      Never underestimate the power of human stupidity RAH

      M 1 Reply Last reply
      0
      • M Mycroft Holmes

        michael_jhons wrote:

        is there any way to directly attach the datatable to an email

        Not that I can think of. An attachment has to be a physical file rather than an abstraction in memory, unless you write the data into the body of the email (rather a silly solution actually). Why not clean up the attachment file after it has been sent? You could even clean out the attachment folder prior to sending the next email or have a job that periodically cleans the attachments, there are many options here.

        Never underestimate the power of human stupidity RAH

        M Offline
        M Offline
        michael_jhons
        wrote on last edited by
        #3

        thank you Mycroft for your answer, that's what i was thinking about but i wanted to be more sure

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups