Library code snippets
Email Link
Ever wanted to provide an email link in your application to enable your users to contact you, without wanting the complexity of integrating full email support? Just use ShellExecute with this very simple example! All you need to do is use the code below and call OpenEmail (sEmail) where sEmail is the email address.
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
Private Sub OpenEmail(sEmail)
' Mail the email address using
' the default email client
ShellExecute 0, vbNullString, "mailto:" & sEmail,
vbNullString, vbNullString, vbNormalFocus
End Sub
Related articles
Related discussion
-
Regarding Visual Basic Programme
by manjunathsl2007 (0 replies)
-
how do you hide all in VB6
by CapnJack (1 replies)
-
Problem with Input File
by novavb6 (3 replies)
-
How to produce a txt file with a table??
by novavb6 (1 replies)
-
VB6 compatability from XP to Vista
by bronx (1 replies)
i got
compile error:
Sub or function not defined
any idea what that is?
Just follow this;
Dim sDest, sSubject, sBody, sCC, sBCC As String
Call ShellExecute 0, vbNullString, "mailto:" & sDest & "?subject=" & sSubject & _
"&body=" & sBody & "&CC=" & sCC & "&BCC=" & sBCC, _
vbNullString, vbNullString, vbNormalFocus
'And of course substitute the string variables with the values u want.
Make it and it will work........
Right...
Thanx!
Doesn't work for me
( I get a syntax error in the line with shelexecute(...) - VB6 says it expects "=" in that line (?)
Can anyone help, please?
can I put the message and send automatic?
This thread is for discussions of Email Link.