?
Solved

Sending Formatted Email via ShellExecute() Problem?

Posted on 2003-03-27
4
Medium Priority
?
152 Views
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?

Regards

   

0
Comment
Question by:mathu76
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 9

Expert Comment

by:tkalchev
ID: 8223885
mailto:somemail@somedomain.com?Subject=SomeSubject&Body=Name%20%20:%20X%0ACompany%20Name%20%20:%20B%0AEmail%20Address%20:%20a@b.com
0
 

Author Comment

by:mathu76
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.
       
0
 
LVL 9

Accepted Solution

by:
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

0
 

Author Comment

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

Regards
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month11 days, 7 hours left to enroll

752 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