Cedced41
Messages postés2Date d'inscriptionmercredi 13 juillet 2005StatutMembreDernière intervention 3 octobre 2005
-
26 sept. 2005 à 16:01
Cedced41
Messages postés2Date d'inscriptionmercredi 13 juillet 2005StatutMembreDernière intervention 3 octobre 2005
-
3 oct. 2005 à 11:14
Bonjour ,
Je souhaite créer un mail via mon appli C++ sous pocket PC 2003.
mon appli s'appelle : PROJET
Actuellement j'arrive à créer le mail avec tous les paramêtres, mais il se place dans le dossier "BROUILLON" du compte "Courrier Outlook"
alors que je voudrais qu'il se place dans le répertoire "Boîte d'envoi" du dossier "PROJET" que j'ai paramêtré précédement.
voici mon code source :
Citation:
,
----
/////////////////////////////////////////////////////////////////////////////
// Function name : CMailObj::SubmitMail
// Description : Creates a new message in the message store
//
// Return type : BOOL - RETURNS TRUE if Successful, FALSE otherwise.
//
// Argument : LPTSTR lpszTo - Pointer to a string containing
// Recipient's Name.
//
// Argument : LPTSTR lpszSubject - Pointer to a string containing
// the Message Subject.
//
// Argument : LPTSTR lpszBody - Pointer to a string containing
// the Body of the Message.
//
// Argument : LPTSTR lpszAttach - Pointer to a string containing
// the path & file of the attachment.
//
BOOL CEMailHandler::SubmitMail(LPTSTR lpszTo, LPTSTR lpszSubject, LPTSTR lpszBody, LPTSTR lpszAttachPath)
{
BOOL bReturn = TRUE;
HANDLE phNewMail = NULL;
MailMsg Msg;
MailAtt MAtt;
// Check for an attachment
if (*lpszAttachPath)
{
// Clear the MailAtt Structure
memset(&MAtt, 0, sizeof(MailAtt));
// Setup the Mail Attachment Structure
MAtt.uiAttachmentNumber = 1;
MAtt.dwFlags = NULL;
//MAtt.ulCharacterPosition; // NOT SUPPORTED YET!
MAtt.ulSize = NULL; // Not needed since we are sending a local file
// Place the message on the message store.
bReturn = MailPut ( phNewMail, &Msg );
if (( bReturn ) && ( NULL != &Msg ))
{
if(*lpszAttachPath)
{
#ifdef _DEBUG
char outstring[300];
wsprintf((unsigned short*)outstring, L"Attachment Path = \"%s\" \n", MAtt.szLocalName);
OutputDebugString((unsigned short *)outstring);
#endif
// Note that MailPutAttachment will attach the file to
// the mailmsg and also DELETE THE ORIGINAL FILE.
// You might want to copy the original file
// before attaching it. Also note that since it deletes
// the original, you will get an error when attempting
// to attach a file that exists on ROM.
bReturn = MailPutAttachment(phNewMail, &Msg, &MAtt);
}
}
}
// Release our new Mail Handle
if(phNewMail) MailClose(phNewMail);
return bReturn;
}
Le code "Msg.szSvcNam = TEXT("Projet");" devrait indiquer le nom du dossier dans lequel copier le mail mais apparement cela ne marche pas.
il se place toujours dans le dossier "Courrier Outlook" par défaut.