473,387 Members | 1,464 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,387 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 14996

"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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.