|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Cannot send email using Outlook component!
Hi,
I'm working on a VB program which uses a DHTML page to collect a user survey. When the user clicks "Submit" on the survey page, I have code to collect the survey data, create a results file, then email it to a specific recipient. I'm deploying the application using the VB6 Packaging and Deployment Wizard, and it is linked with the Outlook 9.0 project reference. This works great, if Outlook is installed on the user's machine. However, if Outlook is not installed, I cannot send the emails, even though the VB-created installer drops a reference to the Outlook object library on the user's PC. Is this by design, or am I doing something wrong here? The code is posted below. Thanks in advance Eric Dim emailAddr As String, myDate As String, subjLine As String ' format subject line Dim name As String name = tbName.Value ' grab the name from the web page. res = SplitName(name) myDate = Date subjLine = "Pilot survey results- " & fName & " " & lName & " - " & myDate emailAddr = "name@location.com" Dim olApp As Outlook.Application Set olApp = CreateObject("Outlook.Application") Set msg = olApp.CreateItem(olMailItem) Set myRecipient = msg.Recipients.Add(emailAddr) Set myAttachments = msg.Attachments myAttachments.Add "c:\survey\data.results", olByValue, 1, "Survey Results" msg.Subject = subjLine msg.body = subjLine 'send message msg.Send |
|
#2
|
|||
|
|||
|
Does the user have any MAPI compliant program installed? I believe that this may be the issue.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Cannot send email using Outlook component! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|