Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Sending Formatted Email via ShellExecute() Problem?

Posted on 2003-03-27
Medium Priority
Last Modified: 2010-05-01
Hi All

I am making a dialog based application.

In one of my DlgBoxes i need to take some input from the user and email the same at some address.

Now the problem is that i am not able to format the email body properly.

I have 3 edit boxes where i prompt the user to enter his name, his company name and his email address.

Using the ShellExecute(), i am able to fill correct entries in the to: cc: subject: editboxes but the real problem comes when i try to write the body content.

Under current circumstances name,company name and email address are being displayed on the same line whereas i want them to come in seperate lines as:

Name:               X
Company Name:       Y
Email Addrss:       X@y.com

Waiting for suggestions?



Question by:mathu76
  • 2
  • 2

Expert Comment

ID: 8223885

Author Comment

ID: 8229580
Thanks tKalchev for your suggestion in my dialog based mfc application i cannot do like this.

The point is that as a result of the user entering the text in the three edit boxes i have three CString objects to deal with (Name,Company Name and Email). so first i would need to do the formatting first and then only i think i can assign the resultant string to the Body variable.

Waiting for comments.

Accepted Solution

tkalchev earned 280 total points
ID: 8229945
Then simply concatenate the strings :

"mailto:" + The Email address to which you must send the email +
"?Subject=" + Desired Subject +
"&Body=Name%20%20:%20" + Name Field +  
"%0ACompany%20Name%20%20:%20" + Company Name +  
"%0AEmail%20Address%20:%20" + Email Field


Author Comment

ID: 8238147
Thanx tKalchev for your comments.Your suggestion has helped me to solve my problem.
Thanx once again.


Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

580 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