|
-
Nov 8th, 2004, 12:20 AM
#1
Thread Starter
New Member
E-mails Through Visual Basic..... ??
I was wondering how does one make an email go through visual basic? I.E. Using VB to send an email through Outlook Express... Any idea's or code?
Thanks
-Phil
-
Nov 8th, 2004, 01:09 AM
#2
Search the Forums. Allot of examples already. Search for
"ShellExecute" + "mailto".
HTH
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 8th, 2004, 06:27 AM
#3
Put your email address in the lblEmail.Caption. Just click the email label and it will send using Outlook or Outlook Express.
VB Code:
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 lblEmail_Click()
ShellExecute Me.hwnd, "open", "mailto:" & lblEmail.Caption & "? _
subject=" & App.Title, vbNullString, vbNullString, SW_SHOW
End Sub
This as been asked a few times on here.
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
-
Nov 8th, 2004, 06:32 AM
#4
Banned
isnt winsock safer? because its non OS setting dependent
-
Nov 8th, 2004, 01:24 PM
#5
ShellExecute is safe and only needs Windows NT 3.1 or later or
Windows 95 or later.
Only a few times? I got 123 hits on the search ShellExecute + mailto
and have seen it asked many times going back to 1999. This is
not a new idea.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 8th, 2004, 03:31 PM
#6
Addicted Member
You could also use the MAPI controls that come along with VB. They are pretty well documented.
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
|