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.
Printable View
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.
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
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 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.
Quote:
Originally Posted by hyousuf2
You can only see the print and preview in mail client. You can't see it using Visual Basic.
The code I wrote will not depend on Outlook. It will use which ever email client program they have installed.
well it doesn't matter now, as im using AspEmail com object !