Join File to email

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
fructuosoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CSecurityCommented:
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
CSecurityCommented:
Or
&attachments=""C:\Screenshot.jpg""

Try &Attach and &attachments

one of them should work
0
iUsernameCommented:
you forge the mailto with "attachment":

mailto:blabla@bla.com?subject=mySubject&body=MyBody&attachment="c:\myfile.txt"
0
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

fructuosoAuthor Commented:
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
itsmeandnobodyelseCommented:
0
itsmeandnobodyelseCommented:
You may download blat for your purposes:

http://sourceforge.net/projects/blat/files/
0
fructuosoAuthor Commented:
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
itsmeandnobodyelseCommented:
>>>> 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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
fructuosoAuthor Commented:

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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.