From 43af797adba26dc6df185fa93b279e879351a1dc Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 22 Apr 2010 15:26:16 +0000 Subject: [PATCH] Patch level : 10.0 Files correlati : xvaga.dll ve1.exe Ricompilazione Demo : [ ] Commento : Aggiunto supporto per richiesta di conferma lettura delle mail git-svn-id: svn://10.65.10.50/trunk@20370 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- xvaga/email.h | 54 +++++++++++++++++++++++++++++++++++-- xvaga/msg.h | 69 ----------------------------------------------- xvaga/smapi.cpp | 8 ++++-- xvaga/smapi.h | 4 +-- xvaga/xvt.h | 2 +- xvaga/xvtmail.cpp | 12 ++++++--- 6 files changed, 69 insertions(+), 80 deletions(-) delete mode 100755 xvaga/msg.h diff --git a/xvaga/email.h b/xvaga/email.h index 7817e320a..7636705b2 100755 --- a/xvaga/email.h +++ b/xvaga/email.h @@ -4,7 +4,7 @@ // Author: Julian Smart // Modified by: // Created: 2001-08-21 -// RCS-ID: $Id: email.h,v 1.3 2009-02-23 11:44:41 guy Exp $ +// RCS-ID: $Id: email.h,v 1.4 2010-04-22 15:26:15 guy Exp $ // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -12,7 +12,57 @@ #ifndef _WX_EMAIL_H_ #define _WX_EMAIL_H_ -#include "msg.h" +/* + * wxMailMessage + * Encapsulates an email message + */ + +class wxMailMessage +{ +public: + + // A common usage + wxMailMessage(const wxString& subject, const wxString& to, + const wxString& body, const wxString& from = wxEmptyString, + const wxString& attachment = wxEmptyString, + const wxString& attachmentTitle = wxEmptyString) : m_query_receipt(false) + { + m_to.Add(to); + m_subject = subject; + m_body = body; + m_from = from; + if (!attachment.IsEmpty()) + { + m_attachments.Add(attachment); + m_attachmentTitles.Add(attachmentTitle); + } + } + + wxMailMessage() : m_query_receipt(false) {} + +//// Accessors + + void AddTo(const wxString& to) { m_to.Add(to); } + void AddCc(const wxString& cc) { m_cc.Add(cc); } + void AddBcc(const wxString& bcc) { m_bcc.Add(bcc); } + void AddAttachment(const wxString& attach, const wxString& title = wxEmptyString) + { m_attachments.Add(attach); m_attachmentTitles.Add(title); } + + void SetSubject(const wxString& subject) { m_subject = subject; } + void SetBody(const wxString& body) { m_body = body; } + void SetFrom(const wxString& from) { m_from = from; } + +public: + wxArrayString m_to; //The To: Recipients + wxString m_from; //The From: email address (optional) + wxArrayString m_cc; //The CC: Recipients + wxArrayString m_bcc; //The BCC Recipients + wxString m_subject; //The Subject of the message + wxString m_body; //The Body of the message + wxArrayString m_attachments; //Files to attach to the email + wxArrayString m_attachmentTitles; //Titles to use for the email file attachments + bool m_query_receipt; //Query receipt message +}; /* * wxEmail diff --git a/xvaga/msg.h b/xvaga/msg.h deleted file mode 100755 index 240edbb42..000000000 --- a/xvaga/msg.h +++ /dev/null @@ -1,69 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: msg.h -// Purpose: wxMailMessage -// Author: Julian Smart -// Modified by: -// Created: 2001-08-21 -// RCS-ID: $Id: msg.h,v 1.2 2008-03-11 15:43:15 alex Exp $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSG_H_ -#define _WX_MSG_H_ - -#include "wxinc.h" - -/* - * wxMailMessage - * Encapsulates an email message - */ - -class wxMailMessage -{ -public: - - // A common usage - wxMailMessage(const wxString& subject, const wxString& to, - const wxString& body, const wxString& from = wxEmptyString, - const wxString& attachment = wxEmptyString, - const wxString& attachmentTitle = wxEmptyString) - { - m_to.Add(to); - m_subject = subject; - m_body = body; - m_from = from; - if (!attachment.IsEmpty()) - { - m_attachments.Add(attachment); - m_attachmentTitles.Add(attachmentTitle); - } - } - - wxMailMessage() {}; - -//// Accessors - - void AddTo(const wxString& to) { m_to.Add(to); } - void AddCc(const wxString& cc) { m_cc.Add(cc); } - void AddBcc(const wxString& bcc) { m_bcc.Add(bcc); } - void AddAttachment(const wxString& attach, const wxString& title = wxEmptyString) - { m_attachments.Add(attach); m_attachmentTitles.Add(title); } - - void SetSubject(const wxString& subject) { m_subject = subject; } - void SetBody(const wxString& body) { m_body = body; } - void SetFrom(const wxString& from) { m_from = from; } - -public: - wxArrayString m_to; //The To: Recipients - wxString m_from; //The From: email address (optional) - wxArrayString m_cc; //The CC: Recipients - wxArrayString m_bcc; //The BCC Recipients - wxString m_subject; //The Subject of the message - wxString m_body; //The Body of the message - wxArrayString m_attachments; //Files to attach to the email - wxArrayString m_attachmentTitles; //Titles to use for the email file attachments -}; - -#endif // _WX_MSG_H_ - diff --git a/xvaga/smapi.cpp b/xvaga/smapi.cpp index dd1396bd3..abc87dd71 100755 --- a/xvaga/smapi.cpp +++ b/xvaga/smapi.cpp @@ -4,7 +4,7 @@ // Author: PJ Naughter // Modified by: Julian Smart // Created: 2001-08-21 -// RCS-ID: $Id: smapi.cpp,v 1.4 2009-03-23 10:37:33 alex Exp $ +// RCS-ID: $Id: smapi.cpp,v 1.5 2010-04-22 15:26:15 guy Exp $ // Copyright: (c) PJ Naughter // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -453,9 +453,13 @@ bool wxMapiSession::Send(wxMailMessage& message, bool show_ui) } } } + + if (nRecipIndex > 0 && message.m_query_receipt) + mapiMessage.flFlags |= MAPI_RECEIPT_REQUESTED; //Do the actual send using MAPISendMail - ULONG nError = m_data->m_lpfnMAPISendMail(m_data->m_hSession, 0, &mapiMessage, show_ui ? MAPI_DIALOG : 0, 0); + const UINT nFlags = show_ui ? MAPI_DIALOG : 0; + ULONG nError = m_data->m_lpfnMAPISendMail(m_data->m_hSession, 0, &mapiMessage, nFlags, 0); if (nError == SUCCESS_SUCCESS) { bSuccess = TRUE; diff --git a/xvaga/smapi.h b/xvaga/smapi.h index a5388c350..052955f14 100755 --- a/xvaga/smapi.h +++ b/xvaga/smapi.h @@ -4,7 +4,7 @@ // Author: PJ Naughter // Modified by: Julian Smart // Created: 2001-08-21 -// RCS-ID: $Id: smapi.h,v 1.3 2009-02-23 11:44:41 guy Exp $ +// RCS-ID: $Id: smapi.h,v 1.4 2010-04-22 15:26:15 guy Exp $ // Copyright: (c) PJ Naughter // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -12,7 +12,7 @@ #ifndef _WX_SMAPI_H_ #define _WX_SMAPI_H_ -#include "msg.h" +#include "email.h" class wxMapiData; diff --git a/xvaga/xvt.h b/xvaga/xvt.h index f8d8388bd..e33173d4d 100755 --- a/xvaga/xvt.h +++ b/xvaga/xvt.h @@ -497,7 +497,7 @@ XVTDLL BOOLEAN xvt_prop_set_read_only(WINDOW win, XVT_TREEVIEW_NODE no XVTDLL BOOLEAN xvt_prop_suspend(WINDOW win); XVTDLL BOOLEAN xvt_mail_send(const char* to, const char* cc, const char* ccn, - const char* subject, const char* msg, const char* attach, BOOLEAN ui); + const char* subject, const char* msg, const char* attach, short flags); // 0x1=UI; 0x2=Receipt XVTDLL void xvt_btn_set_images(WINDOW win, XVT_IMAGE up, XVT_IMAGE down); XVTDLL int xvt_net_get_status(); diff --git a/xvaga/xvtmail.cpp b/xvaga/xvtmail.cpp index 25af77c84..f3f6d5370 100755 --- a/xvaga/xvtmail.cpp +++ b/xvaga/xvtmail.cpp @@ -1,23 +1,27 @@ #include "wxinc.h" #include "xvt.h" -#include "msg.h" #include "email.h" #include BOOLEAN xvt_mail_send(const char* to, const char* cc, const char* ccn, const char* subject, const char* msg, - const char* attach, BOOLEAN ui) + const char* attach, short flags) { + bool ui = (flags & 0x1) != 0; + wxStringTokenizer tokTo(to, _T(";")); wxMailMessage Msg(subject, tokTo.GetNextToken(), msg); + if (flags & 0x2) + Msg.m_query_receipt = true; + while (tokTo.HasMoreTokens()) Msg.AddTo(tokTo.GetNextToken()); if (Msg.m_to[0].IsEmpty()) { Msg.m_to[0] = " "; // Il destinatario "" fa piantare MAPI con errore 25 - ui = TRUE; // Forza user interface in assenza di recipient + ui = true; // Forza user interface in assenza di recipient } if (attach && *attach) @@ -43,7 +47,7 @@ BOOLEAN xvt_mail_send(const char* to, const char* cc, const char* ccn, xvt_fsys_save_dir(); wxEmail Mail; - BOOLEAN ok = Mail.Send(Msg, wxEmptyString, ui != 0); + BOOLEAN ok = Mail.Send(Msg, wxEmptyString, ui); xvt_fsys_restore_dir(); return ok;