Link to home
Start Free TrialLog in
Avatar of fructuoso
fructuoso

asked on

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
Avatar of CSecurity
CSecurity
Flag of Iran, Islamic Republic of image

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

Try &Attach and &attachments

one of them should work
Avatar of iUsername
iUsername

you forge the mailto with "attachment":

mailto:blabla@bla.com?subject=mySubject&body=MyBody&attachment="c:\myfile.txt"
Avatar of fructuoso

ASKER

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

http://sourceforge.net/projects/blat/files/
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
ASKER CERTIFIED SOLUTION
Avatar of itsmeandnobodyelse
itsmeandnobodyelse
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

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