Solved

Pop up user mail

Posted on 2009-07-05
4
177 Views
Last Modified: 2013-12-14
Hi,
I would like to know how can i pop up the default email box of a user when there is an error in an (my) application. In the mail it will have my mailing adress and a default message which can be rewrite by the user.
If you have any ideas it will help me a lot
Thank you

0
Comment
Question by:fructuoso
  • 2
  • 2
4 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 24780096
The easiest way would probably be to use 'ShellExecute()' (http://msdn.microsoft.com/en-us/library/bb762153(VS.85).aspx), e.g.


#include <tchar.h>
#include <shellapi.h>
 
void SendErrorMail()
{
  LPCTSTR pszCmd = _T("mailto:joeuser@foo.com&subject=Error&body=An error has occured.");
 
  ShellExecute(NULL,_T("open"),pszCmd,NULL,NULL,SW_SHOW);
}

Open in new window

0
 

Author Comment

by:fructuoso
ID: 24780178
Thank you for you reply.
I was thinking about this solution. So if you do that it will open the message but not send it ? The user will have the possibility to send it or not.
0
 
LVL 86

Expert Comment

by:jkr
ID: 24780188
>>So if you do that it will open the message but not send it ? The user will have
>>the possibility to send it or not.

Yes, that is exactly what should happen, regardless of any mail client your user is using as the default one.
0
 

Author Comment

by:fructuoso
ID: 24780250
Thank you. I will test it
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

832 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