Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Join File to email

Posted on 2009-07-06
9
Medium Priority
?
254 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
Technology Partners: 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

636 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