View Full Version : sending e-mail
Bosko_Buha
10-16-2002, 06:12 PM
Hi,
I'm writing an installer for a DB program. What I need, is to send an e-mail back to my server (if the user alows this) after the program has finished installing. Does anybody know how to send e-mails in C++. Or if this can even be done since the actual e-mail won't be getting sent from my machine.
Thanks.
bwkaz
10-16-2002, 06:56 PM
What system will this database program be installed to? If a Unix system, Unix has some fun command-line mail programs you can use (/bin/mail is one) to send e-mail, assuming the user has configured them properly. Executing them is a little tougher, but not too bad, you just need a decent grasp of the fork() and exec...() syscalls, and I/O through pipes.
If you are trying to install to a Windows system, you'll need to find a way to talk SMTP. In this case, the user will have to tell your program what their SMTP server's name is (I think there are ways of getting Outlook, for example, to send mail from another program, which is why all those fun Outlook worms work, but I wouldn't use that if I didn't absolutely have to) before you'll be able to talk to it. But once you know the address, SMTP isn't hard to actually speak, and I'm sure there are tutorials somewhere on the subject.
Bosko_Buha
10-21-2002, 02:55 PM
Thanks!
Now I have one more question. Is there an easy way to figure out what version of Windows the user is running? (ie. 95/98/...)
Even if there isn't, can you please tell me how to do it. ;)
stuka
10-21-2002, 03:23 PM
Bosko: check the naughter.com link in the resources - he's got a freeware bit for doing just that.
bwkaz
10-21-2002, 09:04 PM
You could also look in the MSDN documentation for the GetWindowsVersionEx function -- at least, I'm pretty sure that's what it was. It might have been just GetVersionEx.
Bosko_Buha
10-22-2002, 03:04 PM
Thanks a lot guys. I did it using GetVersionEx. Quite easy when you know the method name. :)
vBulletin® v3.7.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.