Hi,
I have a VB.NET windows app that needs to automatically send a simple text
email when my users run a new version of the app for the first time. I
thought this would be simple, but after days of reading posts and testing, I
see it is not - unless I'm missing something? I'm not an email guru.
All of my users will be running at least Windows 2000, most on XP sp2. Some
of my users will have Outlook, many will be using Outlook Express, some will
have who knows what. Most of my users will not be connected to the internet,
they are in tribal locations in the jungle. Most will connect a couple of
times per day via radio to send and receive email.
I thought with MAPI, I could easily send a message from my code, and it
would not matter what mail client the user had, or whether the user was
connected to the internet: my message would be placed in the outbox of
whatever mail client was the default, and whenever the user sent/received
mail, my message would be sent.
I have run into several problems:
1. the vb6 MAPI code I ported to VB.NET gives me the irritating 5-second
wait box, and when I click Yes, I get the error "Unspecified Failure has
occurred at MSMAPI.IMapMessages.Send(Object vDialog)".
2. I tried SMTP, but my SMTP send gives me "Could not access 'CDO.Message'
object", saying the transport failed to connect to the server. And if I
understand correctly, with SMTP, the user would actually have to have a live
internet connection at the moment my code attempts to send an email, is that
true?
3. Using Outlook objects, it actually works, whether the user is connected
to the internet or not, and whether Outlook is currently running or not - if
the user has Outlook installed. However, there is still the irritating
5-second message box "a program is trying to send mail" the user has to know
to click Yes on.
4. I tried Outlook Redemption, and it works great if Outlook is running and
is connected to the internet - the irritating messagebox is suppressed, and
the email is sent. However, I get errors if Outlook is not actually running,
or else the message I send ends up stuck in the user's Inbox instead of
Outbox.
I'm not sure what is the best solution here. Ideally, I'd like to send an
email (with no warning messagebox popping up) that will go out on the user's
default email client the next time the user sends/receives mail from that
client.
Failing that, if I can code several different ways of trying to send the
email, and try each one in sequence until one of them succeeds, that would be
great too. But I'm at a loss to know what methods are best to try, or the
best way to research those methods.
Does anyone have any recommendations?
Thanks!
David