This is a Visual Basic 6.0 example I created back in 2005. This example shows you how to use the mapi components in VB to take advantage of Office Outlook (2003)'s email abilities. The MSMapi32.ocx is required in order for the code to work properly.
Code:
frmAttachments
vb Code:
'Copyright 2005 "nightwalker83"
Private Sub cmdAttach_Click()
CDFiles.ShowOpen
txtFile.Text = CDFiles.FileName
LstFiles.AddItem CDFiles.FileName
lblCount.Caption = lblCount.Caption + 1
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdDelete_Click()
For r = 0 To LstFiles.ListCount - 1
LstFiles.RemoveItem (0)
lblCount.Caption = lblCount.Caption - 1
Next r
txtFile.Text = ""
End Sub
Private Sub cmdDone_Click()
Me.Hide
End Sub
Private Sub Form_Load()
txtFile.Locked = True
End Sub
frmCompose
vb Code:
Private Sub cmdAttach_Click()
'Show attachments.
frmAttachments.Show vbModal, Me
End Sub
Private Sub cmdClear_Click()
'Clear all fields.
txtTO.Text = ""
txtSubject.Text = ""
txtBody.Text = ""
End Sub
Private Sub cmdClose_Click()
'Unload the form.
Unload Me
End Sub
Private Sub cmdSend_Click()
'Check whether or not to save then send the message.
'If there are no more messages disable the delete button.
If frmMain.MAPIMessages1.MsgCount = "0" Then
cmdDelete.Enabled = False
End If
End Sub
Module1
vb Code:
Public a As Integer
Public Path As String
Nightwalker
Last edited by Nightwalker83; Jun 19th, 2012 at 02:19 AM.
Reason: Fixed spelling!
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu. https://get.cryptobrowser.site/30/4111672
In-order to bypass the security restrictions in office outlook/outlook express you can either try and use a work around such as Redemption or you can uninstall office outlook/outlook express whichever you use and install Windows Live Mail. Windows Live Mail does not have the same security patch applied to it as office outlook/outlook express does so the above code will work without any issues.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu. https://get.cryptobrowser.site/30/4111672
11/07/2010 - See first post for updated attachment! Rewrote the code so that it uses redemption instead of simple mapi. Download redemption from the above url and reference it in the project in-order to use the code.
Last edited by Nightwalker83; Jul 11th, 2010 at 05:43 PM.
Reason: Fixed spelling
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu. https://get.cryptobrowser.site/30/4111672
2. i get an error 429: "ActiveX component can't create object"
You need to download the "Developer" version of Redemption from the above site and install it. Once it is installed reference it in the project.
Edit:
I fixed the send mail problem.
Also, the code does not work without outlook installed! I have suggested this could be changed in the next version of Redemption if say Windows Live Mail is only installed. My original code worked regardless of whether or not outlook was installed on the system.
Last edited by Nightwalker83; Jul 11th, 2010 at 08:51 PM.
Reason: Adding more!
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu. https://get.cryptobrowser.site/30/4111672
1. i already downloaded the developer version, and extracted only the dll without using install.
and the references worked ok, but i got this error, i think because i miss some mapi component
that comes with outlook.
i read in the redemption site that if i don't have outlook i need to download something from microsoft,
i'll check this when i'll have time.
1. i already downloaded the developer version, and extracted only the dll without using install.
and the references worked ok, but i got this error, i think because i miss some mapi component
that comes with outlook.
i read in the redemption site that if i don't have outlook i need to download something from microsoft,
i'll check this when i'll have time.
I'm in the same boat! On my Laptop I only have Windows Live Mail installed.
On the redemption home page it says:
If you are planning to use the RDO family of objects on a Windows server that does not have Outlook, Exchange Server or Exchange Admin installed, you will need to install the standalone version of MAPI from the Microsoft site.
There is a download link for the standalone version of MAPI next to the text. The file is ExchangeMapiCdo.
Edit:
I think I have to rewrite the program to use ExchangeMapiCdo because I installed it on my laptop and my program still failed. Although, maybe that was because ExchangeMapiCdo wasn't referenced in the project.
Last edited by Nightwalker83; Jul 12th, 2010 at 07:39 PM.
Reason: Adding more!
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu. https://get.cryptobrowser.site/30/4111672
I have found some third party components that I can use to send and receive email without outlook. I will start a new thread in the codebank when I have converted all the functions to work without outlook. We Only Do are the components I'm using.
Edit:
The updated version of the code can be found here.
Last edited by Nightwalker83; Aug 8th, 2010 at 01:34 AM.
Reason: Adding more!
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu. https://get.cryptobrowser.site/30/4111672
You need to install and reference Redemption in your project! See post #2.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu. https://get.cryptobrowser.site/30/4111672
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu. https://get.cryptobrowser.site/30/4111672