GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 23-Aug-2007, 19:22
monsieur_jj monsieur_jj is offline
New Member
 
Join Date: Aug 2007
Posts: 1
monsieur_jj is on a distinguished road

Embedded Attachments in a mimefile


I am modifying the class CMimeMessage : public CMimeHeader, i need to modify the

CPP / C++ / C Code:
virtual inline BOOL MakeMimeHeader(CStringA& header, LPCSTR szBoundary, LPCTSTR szFileName)
{
ATLENSURE(szBoundary != NULL);ATLASSERT(szFileName != NULL);
ATLASSUME(m_pszEncodeString != NULL);char szBegin[256];
if (*szBoundary)
{
// this is not the only body partChecked::memcpy_s(szBegin, 256, ATLMIME_SEPARATOR, sizeof(ATLMIME_SEPARATOR));
Checked::memcpy_s(szBegin+6, 250, szBoundary, ATL_MIME_BOUNDARYLEN);*(szBegin+(ATL_MIME_BOUNDARYLEN+6)) = '\0';
}
else
{
// this is the only body part, so output the MIME headerChecked::memcpy_s(szBegin, 256, ATLMIME_VERSION, sizeof(ATLMIME_VERSION));
}// Get file name with the path stripped outTCHAR szFile[MAX_PATH+1];TCHAR szExt[_MAX_EXT+1];Checked::tsplitpath_s(szFileName, NULL, 0, NULL, 0, szFile, _countof(szFile), szExt, _countof(szExt));Checked::tcscat_s(szFile, _countof(szFile), szExt);_ATLTRY{CT2CAEX szFileNameA(szFile);CStringA szDisplayName(szFile);if (m_szDisplayName[0] != '\0')
{
szDisplayName = CT2CAEX<_MAX_FNAME+1>(m_szDisplayName);
}
header.Format("%s\r\nContent-Type: %s;\r\n\tcharset=\"%s\"\r\n\tname=\"%s\"\r\n""Content-Transfer-Encoding: %s\r\nContent-Disposition: attachment;\r\n\tfilename=\"%s\"\r\n\r\n",szBegin, (LPCSTR) m_ContentType, m_szCharset, (LPCSTR) szDisplayName, m_pszEncodeString, (LPCSTR) szFileNameA); return TRUE;}_ATLCATCHALL(){return FALSE;}}

to have an output:

Code:
Content-Type: image/jpeg; name="image003.jpg" Content-Description: image003.jpg Content-Disposition: inline; filename="image003.jpg"; size=2313; creation-date="Wed, 01 Aug 2007 09:51:13 GMT"; modification-date="Wed, 01 Aug 2007 09:51:13 GMT" Content-ID: <image003.jpg@01C7D464.924CE700> Content-Transfer-Encoding: base64 instead of: Content-Type: image/jpeg; charset="Windows-1252" name="image003.jpg" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="image003.jpg"



Ok my problem is when i am extracting and converting a .eml file to a new .eml file to convert the tnef i am having an issue getting the embedded attachments. When i get them instead of having them as embedded i just have them as a regular attachment due to the code by atlmime.h

Now my question is how can i get them back as embedded attachments, get their content-disposition and content ID? Thanks
Last edited by admin II : 24-Aug-2007 at 05:19. Reason: Please surround your C++ code with [cpp] ... [/cpp] added [code] tags
 
 

Recent GIDBlogDeveloping GUIs with wxPython (Part 4) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
General Purpose Computer System vs. Embedded System brookeville Computer Software Forum - Windows 4 26-Aug-2006 17:46
How can i view the attachments in mozilla thunderbird? eldiablo4kassa Computer Software Forum - Windows 3 19-Nov-2004 06:51
Intel Compiler C++ for Embedded Visual C++ kiara C++ Forum 1 15-Jan-2004 09:56
Convertin C++ to eMbedded Visual C++ kiara C++ Forum 0 14-Jan-2004 01:05
Convertin C++ to eMbedded Visual C++ jbalart C++ Forum 0 23-Dec-2003 06:44

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 17:00.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.