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
Shows how to send mail in VB using the Microsoft O...
E-mail:
Click to e-mail author
Website:
http://www.A1VBCode.com/
Submitted:
4/1/2000
Version:
VB5
Compatibility:
VB5, VB6
Category:
Internet Programming
Views:
19247
Shows how to send mail in VB using the Microsoft Outlook object.
Declarations:
none
Code:
' make sure a reference to the Outlook object is set ' place the following code in a command button click event Private Sub cmdSendMail_Click() Dim objOutlook As Outlook.Application Dim objMailItem As Outlook.MailItem Set objOutlook = New Outlook.Application Set objMailItem = objOutlook.CreateItem(olMailItem) With objMailItem.To = "ToAddress" 'recipient's address .Subject = "subject" 'subject box content .Body = "email message" ' message goes here .Attachment = "c:\path\file.txt" ' attach any files here .Send End With Set objMailItem = Nothing Set objOutlook = Nothing End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement