Solved

Sending e-mails from my application.

Posted on 2000-02-14
14
217 Views
Last Modified: 2013-11-20
I would like to send e-mail using my program. My application is for win 9x. user only have dial-up connection to intenet.(like aol,msn,...). I will assume that when sending mail, internet connection is up and running. I am using vc++ 6. Snippet of code or a link to a sample is appreciated.
0
Comment
Question by:Sadhu
  • 3
  • 3
  • 3
  • +3
14 Comments
 
LVL 86

Expert Comment

by:jkr
Comment Utility
Well, the easiest approach would be to

ShellExecute ( NULL, "open", "mailto:recipient@domain.com", NULL, NULL, SW_SHOWNORMAL);

However, if you are interested in some details, see http://www.codeguru.com/internet/index.shtml for comprehensive descriptions...
0
 
LVL 1

Author Comment

by:Sadhu
Comment Utility
Thank you for reply.

I will have just a textbox and user will insert text in it. My program will read e-mail addresses from database and send mail. I am expecting about 50 e-mail addresses, so it would not be practical to open 50 times default mail application..

0
 
LVL 1

Author Comment

by:Sadhu
Comment Utility
Jkr,
I rejected your answer so I can get more opinion. If your answer is best I will give you points
0
 
LVL 23

Expert Comment

by:naveenkohli
Comment Utility
Goto the following site on codeguru. Under the Email section you will find lots of samples om Email...

http://www.codeguru.com/internet/index.shtml

Hope it helps!

Cheers!

0
 
LVL 86

Accepted Solution

by:
jkr earned 100 total points
Comment Utility
At least naveenkohli agrees with me about the CodeGuru site ;-)
0
 
LVL 32

Expert Comment

by:jhance
Comment Utility
I've used ASPMail from ServerObjects in a few projects and have had good results with it.

http://www.serverobjects.com/products.htm#aspmail

While it's primarily marketed as an ASP component, there is no problem using it from any development environment that supports COM.
0
 
LVL 23

Expert Comment

by:naveenkohli
Comment Utility
Hi Jkr,
I never had any differences with you :-)
Infact i did not see that you have mentioned the codeguru site reference in your email... i guess its valentine day's chocolate effect:-)

Lator Gator :-)
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 86

Expert Comment

by:jkr
Comment Utility
Ooops, is it valentine day? Am I supposed to buy flowers for our computers? <S>

0
 
LVL 23

Expert Comment

by:naveenkohli
Comment Utility
I think we should buy flowers .. LOL
0
 

Expert Comment

by:Stevex2
Comment Utility
The easiest way to do it is this way.

ShellExecute(NULL , "open", "mailto:soso@so.com?cc=soso1@so.com;soso2@so.com;soso3@so.com&subject=Hello%20World&body=I%20am%20here",NULL, NULL, SW_SHOWNORMAL);


Just keep adding the address's in with a semicolon seperator. Works well. If the semicolon itself dont work use the ascii equivalent behind a % sign as i did with the spaces above.
0
 
LVL 32

Expert Comment

by:jhance
Comment Utility
Stevex2,

It looks like you're new here.  

"Stomping" on a question like this is incredibly bad form on your part, _ESPECIALLY_ when someone else has already offered the same answer.  You could at least have the courtesy to read through the earlier posts and add something new.  If you had taken the time to read through, you'd also have seen that the ShellExecute/mailto technique is NOT APPLICABLE to this situation.
0
 

Expert Comment

by:Stevex2
Comment Utility
Sorry, Only tried to help with some code that worked in some of my cases.  Next time try to be a little more polite. I just put that in because it had worked for me in the past. I saw it above but he said he needed to add a lot of email addresses so I added to the answer from above. I could care less about the points I have enough to go around. I only try to help.  
0
 

Expert Comment

by:Stevex2
Comment Utility
Sorry about above just took it the wrong way.
0
 
LVL 10

Expert Comment

by:RONSLOW
Comment Utility
Stevex2's answer is not the same as previous.

He supplied a way to send to multiple recipients and to include the subject and body in the command.

I think you own him an apology, jhance :-)

0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now