473,326 Members | 2,128 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

VB6 and Email capability

I have a project within which I need to send an automatically produced
report to a client list. Can anyone point me to documentation on
implimenting an email sending routine within a VB6 program? Code samples?

Thanks

Sal in Iowa
Jul 17 '05 #1
5 14986

"Salgoud Dell" <no****@cfu.net> wrote in message
news:ch**********@news.cfu.net...
I have a project within which I need to send an automatically produced
report to a client list. Can anyone point me to documentation on
implimenting an email sending routine within a VB6 program? Code samples?

Thanks

Sal in Iowa

Here's a function I used to use ages ago - I've since created a .NET
version, so I can't gaurantee that it ever worked (!), but it should give
you some pointers if it doesnt. It makes use of Microsoft's CDO library, so
you will prob. need that installed - I recommend reading up about it, and
CDONTS as well - a simple google search should yield loads of results.

**************** CODE ****************
Public Function fSendMailCDO(sTo As String, sFrom As String, sSubject As
String, sMessage As String) As Boolean
'Returns true if the message was sent, else return's false
'This function cannot guarantee the e-mail was recieved and/or read.
On Error GoTo errorHandler
Dim objConf As New CDO.Configuration
Dim objMessage As New CDO.Message
objConf.Fields.Item(cdoSendUsingMethod).value = 2
objConf.Fields.Item(cdoSMTPServer).value = "skinner"
objConf.Fields.Update

objMessage.Configuration = objConf
objMessage.From = sFrom
objMessage.To = sTo
objMessage.HTMLBody = sMessage
objMessage.Subject = sSubject
objMessage.Send

fSendMailCDO = True
Exit Function
errorHandler:
Select Case err.Number
Case -2147220977: 'E-mail address rejected
Debug.Print fGetErrorLogPrefix + vbCrLf + _
"ERROR: EMAIL ADDRESS REJECTED" + vbCrLf + _
err.Description + vbCrLf + vbCrLf
Case Else
Debug.Print fGetErrorLogPrefix + vbCrLf + _
"UNHANDLED EXCEPTION in fSendMail" + vbCrLf + _
CStr(err.Number) + vbCrLf + _
err.Description
End Select
fSendMailCDO = False
End Function
**************** END CODE ****************

HTH,

Rowland.
Jul 17 '05 #2

use the sendmail.dll from freevbcode

it is free , comes with source ( VB 6 code ) and is superior to most
commercial e-mail components
( can send html formatted mail , with embedded pictures , can send
atachments etc etc etc etc )

if you don`t like external dependancy`s it is even possible to include the
classes in your own project :-)

download it here :

http://www.freevbcode.com/ShowCode.Asp?ID=109
happy coding
M. Posseth [MCP]

"Salgoud Dell" <no****@cfu.net> wrote in message
news:ch**********@news.cfu.net...
I have a project within which I need to send an automatically produced
report to a client list. Can anyone point me to documentation on
implimenting an email sending routine within a VB6 program? Code samples?

Thanks

Sal in Iowa

Jul 17 '05 #3
http://www.jsware.net/jsware/vbcode.html

See the email User Control download. It has no
dependencies - no CDO, no Outlook, no Winsock OCX.
It's missing a few niceties like multiple recipients,
CC option, etc., but you can add those easily enough.

--
--
Salgoud Dell <no****@cfu.net> wrote in message
news:ch**********@news.cfu.net...
I have a project within which I need to send an automatically produced
report to a client list. Can anyone point me to documentation on
implimenting an email sending routine within a VB6 program? Code samples?

Thanks

Sal in Iowa

Jul 17 '05 #4
I use Ostrosofts OSSMTP control
(http://www.ostrosoft.com/smtp_component.asp)

It has all the niceties you might expect (CC,BCC, Attachments) and is free.
Works very nicely most of the time, but you might need to tweak your
security settings on some machines if they are particularly high.
I'm using this in a program that sends me an email everyday without fail.

JackFrost
"A day without sun is like night."
"Salgoud Dell" <no****@cfu.net> wrote in message
news:ch**********@news.cfu.net...
I have a project within which I need to send an automatically produced
report to a client list. Can anyone point me to documentation on
implimenting an email sending routine within a VB6 program? Code samples?

Thanks

Sal in Iowa

Jul 17 '05 #5
To all...
Thanks to all for the great tips. I now have my VB application sending out
automatic email reports, efficiently without drawing the wrath of my
anti-virus program. Your help was and always is greatly appreciated. I hope
I can return the favor.

Sal
"Salgoud Dell" <no****@cfu.net> wrote in message
news:ch**********@news.cfu.net...
I have a project within which I need to send an automatically produced
report to a client list. Can anyone point me to documentation on
implimenting an email sending routine within a VB6 program? Code samples?

Thanks

Sal in Iowa

Jul 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Rob Meade | last post by:
Hi all, Ok - at work (NHS) we currently send out emails to everyone in the Trust (approx 2500 people) whenever there's something to say, perhaps a D&V update to let people know which wards are...
0
by: Valerie Smith | last post by:
Hi, I am looking for an email address management software package that can do the following: 1. Mail Merging / Demerging capabilities... a). I will be adding to my list of email addressses...
88
by: Mike | last post by:
Is there a way to determine what a user's default email client is? I read a post from 3 years ago that said no. I guess I'm hoping something has come along since then.
4
by: Colin Kingston | last post by:
Hi For a college project I intend to produce a web based access database which will allow a group leader to send the same email to group members registered for that group. I want the group...
1
by: Jeebu | last post by:
hi, let me explain my problem with a scenario. after completing a registration procees of a user ,an email will be sent to the user for confirmation.the email contains a link and when the user...
1
by: mhsasono | last post by:
Hi all, Has anybody experienced with CrystalReport? My question is: Does CrystalReport have capability to print the Microsoft Word document? Reason: I want to know CrystalReport capability...
8
by: needhelp | last post by:
Hi there, I really need some help, everything I've tried, all I've found, doesn't seem to work. I have lost an email address which is very important to me. I really need to contact that person...
1
by: sasnien | last post by:
Hello All, I have an Access '97 application that I currently have mail enabled and sending properly. However, I want to add functionality to effectively create a 30 day tickler, that would walk...
2
by: Vinny | last post by:
Hi all: Quick question... Is there a capability within MS Sql/Server to automatically generate an email upon the completion of an event? thanks
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.