Re: Automating sending e-mail
- From: "RB Smissaert" <bartsmissaert@xxxxxxxxxxxxxxxx>
- Date: Tue, 11 Jul 2006 00:12:19 +0100
OK, I understand then that the only reliable way is to ask the user and store it somewhere with the option to change.
RBS
"MikeD" <nobody@xxxxxxxxxxx> wrote in message news:ePp9CSHpGHA.4848@xxxxxxxxxxxxxxxxxxxxxxx
"RB Smissaert" <bartsmissaert@xxxxxxxxxxxxxxxx> wrote in message news:OkHWSkGpGHA.516@xxxxxxxxxxxxxxxxxxxxxxxFound what to me looks like some very nice code to send e-mails from VB at:
http://www.freevbcode.com/ShowCode.Asp?ID=109
I thought I could use this to automate sending error data
from an application to my e-mail address.
Would there be a way though to automate:
getting the e-mail address of the sender.
There are several places in the Registry where you can look for it, but no guarantees it'll be there (or be the one you want). It all depends on the email client and/or the version of Windows.
It'll be in the following key if they use Outlook Express:
HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts
(it'll actually be in a subkey of the above)
Under Win9x and WinNT and I think Win2000, you might find it in either of these 2 locations (if the user provided it during registration of Windows)
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\User Information
HKEY_CURRENT_USER\Software\Microsoft\User Information
These keys apparently don't exist under WinXP. The other problem with them is that the email address could very well be outdated. I know people who change their email address every few months because they're always changing ISPs (or because they're careless with it and get hundreds of junk emails a day). Try searching the Registry for your own email address and see where all you find it. Most likely, you'll find it in several places in the Registry. But like I said, none of them are guaranteed for any given PC.
IMO, the best thing you can do is prompt the user for it and save it yourself (and make sure to provide a way for a user to change it).
getting the smtp server used by the sender.
How do you know they're using SMTP? They might be using Exchange or AOL or web-based or some other email method than SMTP/POP3.
--
Mike
Microsoft MVP Visual Basic
.
- References:
- Automating sending e-mail
- From: RB Smissaert
- Re: Automating sending e-mail
- From: MikeD
- Automating sending e-mail
- Prev by Date: Re: Sharing variables across forms in same project?
- Next by Date: Re: Automating sending e-mail
- Previous by thread: Re: Automating sending e-mail
- Next by thread: Re: Automating sending e-mail
- Index(es):
Relevant Pages
|