Results 1 to 11 of 11

Thread: Adding Attachments to a Blank Email on the Client

  1. #1

    Thread Starter
    Hyperactive Member LeeSalter's Avatar
    Join Date
    Oct 2002
    Location
    Notts, England
    Posts
    307

    Adding Attachments to a Blank Email on the Client

    Right then,

    I've searched the internet high and low for an answer to this problem but cannot find one!

    I have an ASP.NET application. From this application I need to add functionality that opens a blank email on the client with an attachment added.

    I need to open a blank email, because the recipients are not known (i.e the user will enter recipients manually). There is no way (as far as I can see) that the System.Net.Mail namespace can do this (sending email with attachments if the recipients are known is a doddle).

    I have cobbled a workaround using the mailto?Attach=filename functionality which works for some users and not others in my organisation.

    Has anybody ever needed to be able to do this? Can anyone help!?

    TIA
    "I'm Brian and so is my Wife"

  2. #2
    Frenzied Member brin351's Avatar
    Join Date
    Mar 2007
    Location
    Land Down Under
    Posts
    1,293

    Re: Adding Attachments to a Blank Email on the Client

    I'm having trouble understanding what it is your trying to do.

    Open the default email client with a mailto link in the html?

    Send an email from the server with attachments to no recipients?

    A little clarification would help

  3. #3

    Thread Starter
    Hyperactive Member LeeSalter's Avatar
    Join Date
    Oct 2002
    Location
    Notts, England
    Posts
    307

    Re: Adding Attachments to a Blank Email on the Client

    OK,

    I need to have my web app open up a blank email on the client machine - as you would if manually composing a new mail.

    The email needs to have an attachment automatically added ready for the user to send. The problem is that the user may want to send the email to any number of people and so rather than sending the email programmatically (which is easy to do using System.Net.Mail), I need the app to simply open an email ready for the user to compose but with the attachment added.

    As I say, I can use the mailto:?Attachment="path_to_filename" method, but this only works for some users in my organisation and not others.
    "I'm Brian and so is my Wife"

  4. #4
    Banned timeshifter's Avatar
    Join Date
    Mar 2004
    Location
    at my desk
    Posts
    2,465

    Re: Adding Attachments to a Blank Email on the Client

    Who's to say you can't send a mass email programatically? I've done it on more than one count. Create a simple web form with space for email addresses, subject, and body. Split the emails based on a delimiter, usually ";". Add them as new System.Net.MailAddress, attach the file, and send it off.

  5. #5

    Thread Starter
    Hyperactive Member LeeSalter's Avatar
    Join Date
    Oct 2002
    Location
    Notts, England
    Posts
    307

    Re: Adding Attachments to a Blank Email on the Client

    It may come to that Timeshifter!

    However, I was thinking it would be easy to simply open a blank email on a client machine and attach a document to it.

    My mailto?Attachment= solution works for some users, not others, so I'll focus on trying to get that working for the time-being. Must be some sort of profile/permission problem.
    "I'm Brian and so is my Wife"

  6. #6

    Thread Starter
    Hyperactive Member LeeSalter's Avatar
    Join Date
    Oct 2002
    Location
    Notts, England
    Posts
    307

    [RESOLVED] Adding Attachments to a Blank Email on the Client

    Finally!!

    This was a client-specific problem.
    Basically in the HKEY_LOCAL_MACHINE/Software/Classes/Mailto/Shell/Open/Command registry key, the Default value needed to have quotes around it, like this:-

    "C:\PROGRA~1\MICROS~2\Office\OUTLOOK.EXE" -c IPM.Note /m "%1"

    instead of

    C:\PROGRA~1\MICROS~2\Office\OUTLOOK.EXE -c IPM.Note /m %1
    "I'm Brian and so is my Wife"

  7. #7
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Adding Attachments to a Blank Email on the Client

    But still not a solution in itself as it won't work on all machines. You could have gotten the user to enter the 'to' addresses, subject, and add attachments.

    Of course, what I said is irrelevant if you're on an intranet.

  8. #8

    Thread Starter
    Hyperactive Member LeeSalter's Avatar
    Join Date
    Oct 2002
    Location
    Notts, England
    Posts
    307

    Re: Adding Attachments to a Blank Email on the Client

    It is on an Intranet, Mendhak. P'raps I should've mentioned that at the beginning!

    As it turns out, even that "fix" doesn't work for all users, so I'm now re-inventing the wheel by designing a form to do this instead.

    Well, it keeps me in work anyway!
    "I'm Brian and so is my Wife"

  9. #9
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Adding Attachments to a Blank Email on the Client

    Well I for one think you're doing it a better way. Rejoice.

  10. #10
    Banned timeshifter's Avatar
    Join Date
    Mar 2004
    Location
    at my desk
    Posts
    2,465

    Re: Adding Attachments to a Blank Email on the Client

    The more control you have over what's happening, the better. I only have mailto links where there can't be a form. Anywhere else an email can be sent to a multitude of users or even just one is all done with custom forms. Works wonderfully.

  11. #11

    Thread Starter
    Hyperactive Member LeeSalter's Avatar
    Join Date
    Oct 2002
    Location
    Notts, England
    Posts
    307

    Re: Adding Attachments to a Blank Email on the Client

    Quote Originally Posted by mendhak
    Well I for one think you're doing it a better way. Rejoice.
    Quote Originally Posted by timeshifter
    The more control you have over what's happening, the better. I only have mailto links where there can't be a form. Anywhere else an email can be sent to a multitude of users or even just one is all done with custom forms. Works wonderfully.
    Chaps, I think that you are right. I'm doing this as a re-usable control too, so once it's finished, I can just plug it in to any other apps the we develop in-house.

    Cheers.
    "I'm Brian and so is my Wife"

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