?
Solved

Join File to email

Posted on 2009-07-06
9
Medium Priority
?
250 Views
Last Modified: 2013-12-14
Hi,
I send a post yesterday in order to pop up the user mail if an error occur in my application.
here is the code to compute that :

void SendErrorMail()
{
LPCTSTR pszCmd = _T("mailto:....&subject=.....&body=......");
ShellExecute(NULL,_T("open"),pszCmd,NULL,NULL,SW_SHOW);
}

I would like to join a file to the mail. Is there an easy way to do that ?
 Especially, can We automaticly make a screenshot and join it to the mail ?
Thank you
0
Comment
Question by:fructuoso
[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
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 17

Expert Comment

by:CSecurity
ID: 24783505
You have to add in this line:
LPCTSTR pszCmd = _T("mailto:....&subject=.....&body=......");
Attach=YOURFILE

like:
LPCTSTR pszCmd = _T("mailto:....&subject=.....&body=......&Attach="C:\Screenshot.jpg");

For taking screen shot you can try this link:
http://www.codeproject.com/KB/mcpp/ijwscrcap.aspx
0
 
LVL 17

Expert Comment

by:CSecurity
ID: 24783511
Or
&attachments=""C:\Screenshot.jpg""

Try &Attach and &attachments

one of them should work
0
 
LVL 5

Expert Comment

by:iUsername
ID: 24783515
you forge the mailto with "attachment":

mailto:blabla@bla.com?subject=mySubject&body=MyBody&attachment="c:\myfile.txt"
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:fructuoso
ID: 24783533
Hi thanks for your reply
I was trying the parameter Attach and i have problem for the synthax for the file path.

I tried
......&Attach="\"C:\\Screenshot.jpg\"")  --> doesn't work

I just tried yours which didn't work too.
I keep on looking but if you have any idea that would be great
Thank you
0
 
LVL 39

Expert Comment

by:itsmeandnobodyelse
ID: 24783642
0
 
LVL 39

Expert Comment

by:itsmeandnobodyelse
ID: 24783661
You may download blat for your purposes:

http://sourceforge.net/projects/blat/files/
0
 

Author Comment

by:fructuoso
ID: 24783665
Ok, I know where the file will be becuse i will create it and put it where i want. I just need to know what is the syntax for the file path to use th attachment parameter. Can you help me to do that ?
Thank you for your reply
0
 
LVL 39

Accepted Solution

by:
itsmeandnobodyelse earned 1500 total points
ID: 24783839
>>>> I just need to know what is the syntax for the file path to use th attachment parameter.
If you read the first link I posted you will see that the answer is 'no', i. e. you can't add attachments when using mailto from commandline.

I don't know it from my own experiences but I googled some time and actualy found not one single evidence for a mailto command with attachments. So, the answer of DreamMaster in the linked thread seems quite ok.

But the blat was able to do what you want:

Excerpt from download information:
-----------------------------------------------------
Enables you to send quick mail messages directly from the command line. It will allow you to attach files to your message. For example, using 'blat - -t destid@xyz.com -s 'test' -attach abc.zip -attach def.zip' will accept keyboard input for a mail message, and send that text with 2 zip files attached! Message text can come from a file as well. Supports MIME quoted-printable and base64 encoding.Information about your mail id & server is stored in the registry, or can be over-ridden on the command line. Excellent for batch files. Includes source.
-----------------------------------------------------
0
 

Author Comment

by:fructuoso
ID: 24784638

Sorry about my missunderstanding.
However I found an other solution.
Someone compute a class in order to do that. Here is the link for programmer who will have the same problem :
http://www.codeproject.com/KB/IP/SendTo.aspx?fid=257922&fr=1&df=90&mpp=25&noise=3&sort=Position&view=Quick#xx0xx

Anyway, thank you for your help

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
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 difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
Suggested Courses

777 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