Q: Sending an e-mail programatically?
-
Hello all. I'am designing some application and I wish that end user could send an e-mail with some attachement by simple pressing button. I want to avoid him of being confused by configuring any connections. I assume that user's machine has already configurated Internet connection (in most cases Dial-Up with modem) and E-mail client installed (in most cases MS Outlook). So I see it working in this way: user clicks on a button and this action runs E-mail client - sets the recipient, message and attachement. User only has to press the Submit button (from e-mail client) (or even without - e-mail is sending automatically). The client optionally calls the Dial-Up connection to set up the connection. I tried opening url ("mailto:xxx@yyy?subject=zzz"), but I cant figure how to set attachement and message body in this manner. So I looked into MAPI specyfication and implemented some sample. But there is a problem: after Submit action, even I have Lotus Notes and MS Outlook installed (LN is default client) I always see an screen to set up the profile. Bleee - this is the less expected thing I wanted to see ... I dont know the MS Exchange technology well. Any help will by appreciated. Similiar mechanism works fine in WinZip. And sorry for my not always briliant english ;-) Best regards
You HAVE to set up the client machine (configure an e-mail profile) at least once before you can use MAPI to send e-mail. Actually, before doing that, you HAVE to add the an e-mail account for this client to the exchange server that is processing the e-mails. If you have done the above, the rest (sending e-mail from a program) is easy. I have sample code (a simple ActiveX control) if you are interested.
-
Hello all. I'am designing some application and I wish that end user could send an e-mail with some attachement by simple pressing button. I want to avoid him of being confused by configuring any connections. I assume that user's machine has already configurated Internet connection (in most cases Dial-Up with modem) and E-mail client installed (in most cases MS Outlook). So I see it working in this way: user clicks on a button and this action runs E-mail client - sets the recipient, message and attachement. User only has to press the Submit button (from e-mail client) (or even without - e-mail is sending automatically). The client optionally calls the Dial-Up connection to set up the connection. I tried opening url ("mailto:xxx@yyy?subject=zzz"), but I cant figure how to set attachement and message body in this manner. So I looked into MAPI specyfication and implemented some sample. But there is a problem: after Submit action, even I have Lotus Notes and MS Outlook installed (LN is default client) I always see an screen to set up the profile. Bleee - this is the less expected thing I wanted to see ... I dont know the MS Exchange technology well. Any help will by appreciated. Similiar mechanism works fine in WinZip. And sorry for my not always briliant english ;-) Best regards
Hello again :) After receiving some answers (thank you very much!) I want to slightly modify the question: Is anybody know how to send e-mail programatically (with attachement and message) without using MAPI (like WinZip menu-context: 'Zip and Email sth.zip')? Becase potential end-users are rather rookies than professionals :) I don't want to get them confused by configuring profiles with Exchange server. Is there any way to get an advantage of Ms Outlook or Lotus Notes installed and configured? As I know those apps don't use Exchandge profiles and vice versa. Best regards and smile :)
-
Hello again :) After receiving some answers (thank you very much!) I want to slightly modify the question: Is anybody know how to send e-mail programatically (with attachement and message) without using MAPI (like WinZip menu-context: 'Zip and Email sth.zip')? Becase potential end-users are rather rookies than professionals :) I don't want to get them confused by configuring profiles with Exchange server. Is there any way to get an advantage of Ms Outlook or Lotus Notes installed and configured? As I know those apps don't use Exchandge profiles and vice versa. Best regards and smile :)
I haven't used this myself, but it looks like this may be what you want: http://www.codeproject.com/internet/csmtpconn.asp
-
I haven't used this myself, but it looks like this may be what you want: http://www.codeproject.com/internet/csmtpconn.asp
OK - it's fine. But as I said before - there is a need to specify SMTP server - beginner users not always know it. And then I should call Dial-Up connection where MS Outlook does it all for me. Regards Bartek
-
I haven't used this myself, but it looks like this may be what you want: http://www.codeproject.com/internet/csmtpconn.asp
try using pj naughter's pop3 and smtp classes they work real good (if you use unicode you'll have to make a couple of mods) :) mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
-
Hello all. I'am designing some application and I wish that end user could send an e-mail with some attachement by simple pressing button. I want to avoid him of being confused by configuring any connections. I assume that user's machine has already configurated Internet connection (in most cases Dial-Up with modem) and E-mail client installed (in most cases MS Outlook). So I see it working in this way: user clicks on a button and this action runs E-mail client - sets the recipient, message and attachement. User only has to press the Submit button (from e-mail client) (or even without - e-mail is sending automatically). The client optionally calls the Dial-Up connection to set up the connection. I tried opening url ("mailto:xxx@yyy?subject=zzz"), but I cant figure how to set attachement and message body in this manner. So I looked into MAPI specyfication and implemented some sample. But there is a problem: after Submit action, even I have Lotus Notes and MS Outlook installed (LN is default client) I always see an screen to set up the profile. Bleee - this is the less expected thing I wanted to see ... I dont know the MS Exchange technology well. Any help will by appreciated. Similiar mechanism works fine in WinZip. And sorry for my not always briliant english ;-) Best regards
Why Not send a link ?? There are security concerns to consider when sending attachments, But Links become the users resposibility ! Regardz Colin Davies redo C++ , Coder
-
Why Not send a link ?? There are security concerns to consider when sending attachments, But Links become the users resposibility ! Regardz Colin Davies redo C++ , Coder
Huh, it was a little delay since last reply ;-) Could you explain what does it mean: send a link? Regards Bartosz Lizak
-
OK - it's fine. But as I said before - there is a need to specify SMTP server - beginner users not always know it. And then I should call Dial-Up connection where MS Outlook does it all for me. Regards Bartek
As said before, there are two ways: MAPI or POP3/SMTP. Using MAPI you take advantage of your email application installed on the same computer, assuming that email application handles MAPI (most do). All you have to do is select that application as MAPI application, this is done in the application's preferences (Outlook/Netscape etc). There are some classes on CodeTools for simplifying the MAPI job, but VC++ 6.0 docs contains a good guide also. Sending email is a LOT easier than receiveing and I'd guess that WinZip uses MAPI to send it's email.
-
Huh, it was a little delay since last reply ;-) Could you explain what does it mean: send a link? Regards Bartosz Lizak
Hi, I have not done this before, but I'd like to do it some day fro myself as well as I thought of it once long ago! :) One thing though, isn't the attachment an exisitng in HD file! Try it with FTP stuff! I've seen some apps w/source code but in VB that show how to send files with FTP. :) Am gonna follow up to find stuff I had before, meanwhile please let me know as well of your findings! Cheers "Silence is golden, but my eyes still see." -- Masoud Samimi Website: www.geocities.com/samimi73
-
Huh, it was a little delay since last reply ;-) Could you explain what does it mean: send a link? Regards Bartosz Lizak
Using "MAPI" eg your default "email program" Send an e-mail with an "html link" in the Body ! You'll have to make sure your user FTpUploads the file to the predefined "html link" on a server. I've implemented it in a Demo APP of mine at http://www.ownguide.tv if you car to download it at look ! Regardz Colin Davies