|
-
December 14th, 1999, 07:22 PM
#1
Opening e-mail and adding an attachment
I want to add some functionality to an app so that when a user clicks on an email address it will open up the default email browser, so far I can do this using ShellExecute, however I also want to be able to add an attachment automatically if the user has already selected a file. I was just wondering if there was a way to do this. I'm not sure if ShellExecute would work for this, but even so if there is another way I could target certain apps such as Outlook Express and Eudora by having a command line paramter that adds the attachment that would probably work. Any help is greatly appreciated.
-
December 16th, 1999, 03:10 PM
#2
Re: Opening e-mail and adding an attachment
-
December 16th, 1999, 04:06 PM
#3
Re: Opening e-mail and adding an attachment
You may want to consider bypassing the default e-mail app and sending e-mail in your application directly via winsock. There is an example at http://www.freevbcode.com/ShowCode.Asp?ID=109 that is a .dll for this purpose. Attachments are supported.
This is only for SMTP mail, so if you are supporting another kind of messaging, you can do what the other response suggested, but you will be limited to the outlook client.
-
December 16th, 1999, 05:34 PM
#4
Thanks
Just wanted to say thanks to the both of you for your help.
-
December 20th, 1999, 03:44 AM
#5
Re: Opening e-mail and adding an attachment
Hi!
I want to do the same thing that you have done, that is opening the default e-mail application, when the user clicks on the e-mail address which is
displayed in the msflexgrid. And that e-mail address should be passed on
to the To: slot of the e-mail application.
Could you please send me the code for it. I have been trying to do this
for quite some time. I would really appreciate your help.
Thanks.
-
December 21st, 1999, 07:17 PM
#6
Here you go
Sorry it took so long, but my DSL line was down for a while...
Here's the API call you have to declare in a .bas module
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
and here's the function call:
Dim link As Long
link = ShellExecute(0&, vbNullString, "mailto:" & EMAIL_ADDRESS_HERE, vbNullString, vbNullString, vbNormalFocus)
where EMAIL_ADDRESS_HERE is a String variable with the user's email address
hope this 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|