Sending e-mails from my application.

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.
LVL 1
SadhuAsked:
Who is Participating?
 
jkrConnect With a Mentor Commented:
At least naveenkohli agrees with me about the CodeGuru site ;-)
0
 
jkrCommented:
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
 
SadhuAuthor Commented:
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
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
SadhuAuthor Commented:
Jkr,
I rejected your answer so I can get more opinion. If your answer is best I will give you points
0
 
naveenkohliCommented:
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
 
jhanceCommented:
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
 
naveenkohliCommented:
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
 
jkrCommented:
Ooops, is it valentine day? Am I supposed to buy flowers for our computers? <S>

0
 
naveenkohliCommented:
I think we should buy flowers .. LOL
0
 
Stevex2Commented:
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
 
jhanceCommented:
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
 
Stevex2Commented:
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
 
Stevex2Commented:
Sorry about above just took it the wrong way.
0
 
RONSLOWCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.