Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email without mail client

Status
Not open for further replies.

Mengbillar

Programmer
Jan 13, 2003
32
DE
Hi there

I have searched through thos forum quite a bit, but almost all email threads ive seen were using/linking to outlook in one way or the other... can i possibly send a mail by using nothing but Winsock? Thanks for your help already :)
 
You need to have an object that is able to send mail.

If you are using NT or 2000 or XP you could use CDONTS.

If you are using 95 or 98 you are out of luck with that object.
 

See thread711-434701 for some suggestions and CDO 1.2.1 does not need to be on NT and above, see MS...

These are the two CDO libraries:

CDO Library This library lets you add to your application the ability to send and receive mail messages and to interact with folders and address books. You can create programmable messaging objects, then use their properties and methods to meet the needs of your application.
CDO Rendering Library This library is used to render CDO objects and collections in HTML for use on the World Wide Web.
Note If your purpose is to run on a Web server to expose content to the Internet, you need a computer running IIS to work with the CDO libraries. However, you can use the CDO Library alone on the client (or on the server) as a scripting library. In this case, it is used as a general-purpose library, and IIS is not required.

and

The CDO Library requires installation of MAPI and of an automation controller. An automation controller is an application that supports Automation, such as the following Microsoft applications:

Microsoft® Visual Basic® 3.0 or later
Microsoft Visual Basic for Applications
Microsoft® Access version 2.0 or later
Microsoft® Excel version 5.0 or later
Microsoft® Project version 4.0 or later
Microsoft Visual C++ version 1.5 or later
Note Microsoft Visual Basic 3.0 does not support multivalued properties.

and

About Installation
The Collaboration Data Objects (CDO) Library version 1.2.1 is installed with the Microsoft® Exchange Client and Server, and with Microsoft® Outlook™ 98. The setup programs register the CDO Library for subsequent use by automation controllers, that is, applications that support Automation.

Note Microsoft® Outlook™ version 8.03 includes the predecessor of CDO version 1.2, namely Active Messaging 1.1.

When you use the CDO Library with an automation controller, verify that the tool has referenced the CDO Library. For example, when you are using Microsoft® Visual Basic® version 4.0, choose the References command from the Tools menu, and select the check box for Microsoft CDO 1.2.1 Library.

When the CDO Library is available, the following flag is set in the WIN.INI file:

[Mail]
OLEMessaging=1

The OLEMsgPersistenceTimeout registry setting controls how quickly the CDO Library shuts down and unloads from memory after all messaging objects are released by client applications. On Win32® systems, the setting appears at the following registry location:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Messaging Subsystem

For 16-bit Microsoft® Windows® systems, the OLEMsgPersistenceTimeout setting appears within the [MAPI] section of the WIN.INI file.

Good Luck

 
Wow ok, I was actually hoping for some easy sollution... just like sending data (e.g. mail headers etc) to some mail server or so.. but well... I will have a look into this CDO thingy then, thanks for all the info about it already :)
When Im just at this seems-easy-but-prooves-almost-impossible stuff: has anyone here ever tried to send messeges to an ICQ user?
 
There are 3 CDO libraries. The one you missed vb5prgrmr (or dismissed) is CDONTS, as suggested by jeexpo. All it requires is access to an MS SMTP gateway (typically the one built-in to IIS). If you have access to such, CDONTS is by far the simplest library. Here's a full but simple example of CDONTS sending a text message:

Set objNewMail = CreateObject("CDONTS.NewMail")
objNewMail.Send "me@tek-tips.com", "you@tek-tips.com", "Hello", "A short text message!", 0 ' low importance
Set objNewMail = Nothing ' cannot reuse it for another message

Three lines to send an email - and two of those are merely object setup and cleanup.
 
Great! As easy as that is what i had hoped to find. But, what server does it use to send the mail, it must use any smtp server, either of the recipients or the senders adress, and what if that server (like most servers today) requires login/pass authentification?
 
No - it requires an SMTP gateway at YOUR end. That gateway wll be configured to speak to other SMTP hosts. That's the big drawback of CDONTS.
 

strongm,

No, did not really miss it since I mentioned it in "See Thread711-434701 for some suggestions" with the quote of...

With API's take a look at MAPI. With an object take a look at CDO/CDONTS. With a control take a look at the MAPI control which wraps the Messaging API (MAPI) and gives you an object to work with.

but then again the informaion was to correct jeepxo's statement of "If you are using 95 or 98 you are out of luck with that object."

And since jeepxo had already mentioned it in this thread why should I mention it again?

 
Ah, but on first reading it looks like you were saying jeexpo was wrong, but they are correct...
 
We use Catalyst. Here is some marketing info:

"The Catalyst Internet Mail control provides a simplified interface for composing, sending and retrieving e-mail messages. If you're a developer who needs to integrate e-mail functionality in your applications, the Internet Mail control includes everything you need in a single component which can be used in a wide variety of programming languages and development environments, including Visual Basic, Visual C++ and Visual Studio.NET."

 
The "e-mail with VB6" posts are quite interesting, esp. the simple CDONTS stuff. Has anyone out there done this entirely within a Microsoft Exchange environment? Or is this one of those situations which require the use of Outlook? I'm working on a datalogging app that runs in the production lab, and I'd like to be able to have it send text reports to the production engineer via e-mail.
 
I tried CDO and MAPI but a friend of mine suggested that I try to use the Internet Mail Control. I have a reference to Microsoft Internet Controls for our online help anyway so I didn't have to add any references.

The starting address is set to mailto:someone@somewhere.com?subject=Some kind of text...

The two issues that I had were the dialog for my email program (Outlook) opens and you can edit the information. Only a problem if you are sending specific data.

The other problem is that you can't send it the message body. If anyone knows how to do so, please let me know.

Thanks,

Jennifer
jzelhart@komputrol.com
 
I think I found my own answer. After I posted yesterday, I checked out the reference in the post by RichieSimonetti earlier in this thread. The component vbSendMail.dll appears to do just what I need. It's an object-orienter e-mail sender with to, from, subject, message, etc. handled as object properties. Attachments are supported, too.
Thanks for the assistance!

AFN/Doug
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top