Dear VB Expert,
How to open default emailer with attachment thru VB6's code? .. I need advise
Thanks & Regards
Winanjaya
Printable View
Dear VB Expert,
How to open default emailer with attachment thru VB6's code? .. I need advise
Thanks & Regards
Winanjaya
Are you trying to read a file with the default client, or send one?
Thanks for your prompt reply, I need to send .pdf thru default email program, when user click a button then it open default email program with .pdf attachment inserted automatically. any idea?
Thanks & Regards
Winanjaya
I just searched, and found this. Hope it helps:
http://www.vbforums.com/showthread.php?t=79636
thanks, but how if they donot use Ms product (ie. eudora .. ) .. any comment?
thanks
Winanjaya
I tried below codes, it works but I cannot insert attachment.. could any body give me tips .. how to insert attachment(s) by using below "mailto" command.
Many thanks in advance
Regards
Winanjaya
Option Explicit
Private 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
Const SW_SHOW = 5
Private Sub OpenEmailer()
If InStr(pubEmail, "@") > 0 Then
ShellExecute Me.hwnd, "open", "mailto: [email protected]" & "?subject=" & App.Title & "&body=Hello World" , vbNullString, vbNullString, SW_SHOW
End If
End Sub
What mail client are you testing with?
In development environment I am using Outlook Express, but my clients had many kinds of email client such as OE, Ms. Outlook, Eudora ..etc
any idea?
Thanks & Regards
Winanjaya
Maybe you should try another approach. I've been reading around and it seems there is no standard way of doing this for all mail clients. Maybe you should search for MAPI or SMTP?
I posted a MAPI example, but it requires Outlook, which comes with Windows.
Outlook does not come with windows, but Outlook Express does. ;)
Your best solution is SMTP but you need access to a SMTP Server too.
Oh, you can't use OE for MAPI?
That could be a problem. I'll have to look at my mailto: section of an app.
Drag. I have MAPI in my app. Doesn't the installer include the files that it needs?
Um, no, I didnt say that but only clarifing that there is a difference between Outlook and Outlook Express. ;)
Since the poster wants to do attachments across all possible versions of a clients default email editor, then SMTP would be ideal. :)
Glad that's resolved. That would have been bad...
Depends on your packager and the references required. If you have any Office references then you cant add their dependancies because you can not distribut Office.Quote:
Originally Posted by dglienna
Nope, just the MAPI component