Link to home
Start Free TrialLog in
Avatar of Sadhu
Sadhu

asked on

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.
Avatar of jkr
jkr
Flag of Germany image

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...
Avatar of Sadhu
Sadhu

ASKER

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..

Avatar of Sadhu

ASKER

Jkr,
I rejected your answer so I can get more opinion. If your answer is best I will give you points
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!

ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
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 :-)
Ooops, is it valentine day? Am I supposed to buy flowers for our computers? <S>

I think we should buy flowers .. LOL
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.
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.
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.  
Sorry about above just took it the wrong way.
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 :-)