Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old July 30th, 2003, 01:26 PM
aryckw aryckw is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: FL
Posts: 1 aryckw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to aryckw
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

Reply With Quote
  #2  
Old July 31st, 2003, 10:10 AM
victorpendleton victorpendleton is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2003
Location: No es importante
Posts: 2,065 victorpendleton User rank is Private First Class (20 - 50 Reputation Level)victorpendleton User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 31 m 56 sec
Reputation Power: 8
Does the user have any MAPI compliant program installed? I believe that this may be the issue.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Cannot send email using Outlook component!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway