Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Send E-mail using Outlook Express
Author:
ganga kumar sinha
E-mail:
Click to e-mail author
Submitted:
7/31/2003
Version:
VB6
Compatibility:
VB6
Category:
Internet Programming
Views:
35965
A simple program which may be used to e-mail. The program will use Outlook Express as default email server and outlook express must be configured properly before using it. No doubt, internet connection is must. It is very easy program, and can be used to send the e-mail with attachment.
Declarations:
'Start new project 'open simple exe file 'go to Project -> Components 'ADd Microsoft Common Dialog Box and 'Microsoft MAPI Control 'three new controls will appear on the tool box 'just put each one on the form 'Name of three controls are 'MAPISession1 'MAPIMessages1 'commondlg1
Code:
Dim filename As String Private Sub Command1_Click() Dim s1 As String Dim b1 As Boolean b1 = False MAPISession1.SignOn MAPISession1.DownLoadMail = False If filename <> "" Then b1 = True End If With MAPIMessages1 .SessionID = MAPISession1.SessionID .Compose .RecipAddress = Text2.Text .AddressResolveUI = True .ResolveName .MsgSubject = Text3.Text If b1 = True Then .AttachmentPathName = filename End If .MsgNoteText = Text4.Text .Send False End With MAPISession1.SignOff 'MAPISession1 = Nothing 'MAPIMessages1 = Nothing End Sub Private Sub Command2_Click() commondlg1.ShowOpen filename = commondlg1.filename Text1 = filename 'Print filename End Sub Private Sub Command3_Click() End End Sub Private Sub Form_Load() filename = "" End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement