|
-
Mar 21st, 2005, 12:10 AM
#1
Thread Starter
Addicted Member
sending a mail
how do i send mail through my vb application, also i want to show it preview, n print it as well, there nothing in the mail its just simple text nothing else.
-
Mar 21st, 2005, 12:16 AM
#2
Re: sending a mail
This will open a new email in the default email client.
VB Code:
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
Private Const SW_SHOWNORMAL As Long = 1
Private Sub Command1_Click()
ShellExecute Me.hwnd, "open", "mailto: [email protected]?subject=Test&body=This is the body", vbNullString, "C:\", SW_SHOWNORMAL
End Sub
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 
-
Mar 21st, 2005, 12:31 AM
#3
Thread Starter
Addicted Member
Re: sending a mail
by writing the code i would be using outlook which i dun wana do, i need to use some custom component n also wat abt the print n preview thing
-
Mar 21st, 2005, 12:36 AM
#4
Frenzied Member
Re: sending a mail
You can use the winsock control to connect to the smtp server, then send the data using the commands in bold on this page:
http://www.netadmintools.com/art276.html
If you need more help with smtp commands just search on google for smtp with telnet or something similar.
-
Mar 21st, 2005, 12:37 AM
#5
Lively Member
Re: sending a mail
 Originally Posted by hyousuf2
by writing the code i would be using outlook which i dun wana do, i need to use some custom component n also wat abt the print n preview thing
You can only see the print and preview in mail client. You can't see it using Visual Basic.
Jobs: "Do u want to sell colored sugar water or change the world?"
Get Firefox Now!!!
Mendhak leaving town. 
-
Mar 21st, 2005, 01:07 AM
#6
Re: sending a mail
The code I wrote will not depend on Outlook. It will use which ever email client program they have installed.
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 
-
Mar 21st, 2005, 04:20 AM
#7
Thread Starter
Addicted Member
Resolved: sending a mail
well it doesn't matter now, as im using AspEmail com object !
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
|