|
-
Jul 26th, 2007, 05:17 AM
#1
Thread Starter
Hyperactive Member
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"
-
Jul 26th, 2007, 06:21 AM
#2
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
-
Jul 26th, 2007, 07:00 AM
#3
Thread Starter
Hyperactive Member
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"
-
Jul 26th, 2007, 07:57 AM
#4
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.
-
Jul 26th, 2007, 08:08 AM
#5
Thread Starter
Hyperactive Member
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"
-
Jul 26th, 2007, 08:19 AM
#6
Thread Starter
Hyperactive Member
[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"
-
Jul 27th, 2007, 01:01 AM
#7
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.
-
Jul 27th, 2007, 10:26 AM
#8
Thread Starter
Hyperactive Member
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"
-
Jul 27th, 2007, 11:01 AM
#9
Re: Adding Attachments to a Blank Email on the Client
Well I for one think you're doing it a better way. Rejoice.
-
Jul 27th, 2007, 12:59 PM
#10
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.
-
Jul 28th, 2007, 05:49 AM
#11
Thread Starter
Hyperactive Member
Re: Adding Attachments to a Blank Email on the Client
 Originally Posted by mendhak
Well I for one think you're doing it a better way. Rejoice. 
 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|