sending mail using default mail client

ganders

Active member
Joined
Nov 25, 2004
Messages
32
hi

the following code opens an outlook mailitem. but what happens, if the user doesnt have outlook installed on his machine??
is there a way to detect the users default mailclient and open a mailitem of this mailclient (i.e. netscape,..)?

best regards


Dim pApp As Outlook.Application
Dim pMail As Outlook.MailItem
pApp = CreateObject("Outlook.Application")
pMail = pApp.CreateItem(Outlook.OlItemType.olMailItem)
pMail.Display()
 
You could shellexecute a hyperlink mailto:emailaddy@server.com?subject=subject

This would do the same as clicking an email address on a web page i.e. open a new mail in the default mail app.
 
attachments?

hi

tx for your reply. the problem is: the newly created mail sould contain an attachment. and as far as i know, this isnt supported in the mailto-protocol.

or is it??

how can i open a mailitem containing an attachment?

regards
 
In that case Im pretty sure what you are trying to accomplish is not possible.

Only possible ways round it that I can think of are:
1. Write code for all possible applications and ask the user/look up in the registry which piece of code is required or
2. write an smtp calss and ask the user for their details then send it yourself.
 
Back
Top