Send letters via VB6 if there is no mail client

I have a VB6 application that is used by a large number of clients.

I need to allow clients to send me letters. I used to do this using Microsoft MAPI tools. However, not all of them have an email client installed, because they use webmail instead.

Is there any other method that anyone can recommend that will allow them to do this?

+2
email vb6
source share
2 answers

SMTP

You can use CDO for Windows to do this if we make a few assumptions:

  • All your users are on Win2K or later.
  • Users will never be behind the firewall blocking SMTP, or proxying all SMTP ports to the corporate server.
  • You have an SMTP server on which you have an account with which you can send mail.
  • The server address and account credentials are embedded in your program.

Sometimes using an SMTP server listening on an alternate port will solve the second problem, but often such an alternate port is even more likely blocked.

SMTP is dying

Over time, abuse has made SMTP less and less viable for automated / user contact with the user. There are too many variables associated with trying to open some kind of “clean channel” for SMTP communications, as people have more difficulty fighting spammers, etc.

Today, I would much more often use WebDAV or a web service for this. Both use HTTP / HTTPS, which are likely to go through firewalls and will usually receive most proxies. WebDAV is often more slippery on this than web services, which are more and more trusted. You can also use something more RESTful than SOAPy, because the traffic "smells" like "viewing users on proxies."

WebDAV is a clean option

There are even free WebDAV providers offering 2 GB of storage with a primary and guest user. The guest account may be granted limited rights to various folders, so some folders can send messages, other folders from which they can receive data (read-only), etc. For a paid account, you can get more storage space, additional users, etc.

It works well. You can even use the same hosting for the program version files, the new version code that you need to download and install, etc. All you need is an aggregator program that fills in the user's messages and deletes them using the main user / pw.

You still need to embed the user credentials in your program, but over time it may be easier to change passwords. Just ask the program to get an information file with a new password and effective date, and the program will turn the “new” password to “current” after launching on that date or after.

Windows WebDAV support is changing. Starting from WinXP SP3 onward, you can simply programmatically map the drive letter to the WebDAV share, and then use the usual file I / O operators for it and cancel the letter when this is done. For more general use even for Win9x, you can create a simple WebDAV client on top of XMLHTTPRequest or use a third-party library.

Web Services Have Higher Costs

Just for starters, you have server-side code for writing and supporting, and you need to use a certain type of hosting. For example, if you built it using PHP, you need a PHP host, an ASP-ASP node, an ASP.Net node, ASP.Net, etc.

Web services can also be more problematic in terms of version control. If you later update your program to provide various information in these user contact messages, you will need to create another web service, as well as change both the application and the aggregator. Using WebDAV, you can simply create a “new format” folder on the server and load the new program into a new format. Your aggregator can simply pull out both folders and make the necessary reformatting in the new local database / message repository format.

This is just an extra extra effort, although a web service can be a way, even if it's just something written as an acceptor of the HTML GET / POST form.

+5
source share

Although this question is about VBA, you may find it interesting. Sending email using VBA without MAPI

0
source share

All Articles