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
This commit is contained in:
parent
5942f2b8e7
commit
43af797adb
@ -4,7 +4,7 @@
|
|||||||
// Author: Julian Smart
|
// Author: Julian Smart
|
||||||
// Modified by:
|
// Modified by:
|
||||||
// Created: 2001-08-21
|
// 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
|
// Copyright: (c) Julian Smart
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
@ -12,7 +12,57 @@
|
|||||||
#ifndef _WX_EMAIL_H_
|
#ifndef _WX_EMAIL_H_
|
||||||
#define _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
|
* wxEmail
|
||||||
|
69
xvaga/msg.h
69
xvaga/msg.h
@ -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_
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
|||||||
// Author: PJ Naughter <pjna@naughter.com>
|
// Author: PJ Naughter <pjna@naughter.com>
|
||||||
// Modified by: Julian Smart
|
// Modified by: Julian Smart
|
||||||
// Created: 2001-08-21
|
// 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
|
// Copyright: (c) PJ Naughter
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
@ -454,8 +454,12 @@ 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
|
//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)
|
if (nError == SUCCESS_SUCCESS)
|
||||||
{
|
{
|
||||||
bSuccess = TRUE;
|
bSuccess = TRUE;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
// Author: PJ Naughter <pjna@naughter.com>
|
// Author: PJ Naughter <pjna@naughter.com>
|
||||||
// Modified by: Julian Smart
|
// Modified by: Julian Smart
|
||||||
// Created: 2001-08-21
|
// 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
|
// Copyright: (c) PJ Naughter
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
@ -12,7 +12,7 @@
|
|||||||
#ifndef _WX_SMAPI_H_
|
#ifndef _WX_SMAPI_H_
|
||||||
#define _WX_SMAPI_H_
|
#define _WX_SMAPI_H_
|
||||||
|
|
||||||
#include "msg.h"
|
#include "email.h"
|
||||||
|
|
||||||
class wxMapiData;
|
class wxMapiData;
|
||||||
|
|
||||||
|
@ -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_prop_suspend(WINDOW win);
|
||||||
|
|
||||||
XVTDLL BOOLEAN xvt_mail_send(const char* to, const char* cc, const char* ccn,
|
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 void xvt_btn_set_images(WINDOW win, XVT_IMAGE up, XVT_IMAGE down);
|
||||||
XVTDLL int xvt_net_get_status();
|
XVTDLL int xvt_net_get_status();
|
||||||
|
@ -1,23 +1,27 @@
|
|||||||
#include "wxinc.h"
|
#include "wxinc.h"
|
||||||
#include "xvt.h"
|
#include "xvt.h"
|
||||||
|
|
||||||
#include "msg.h"
|
|
||||||
#include "email.h"
|
#include "email.h"
|
||||||
#include <wx/tokenzr.h>
|
#include <wx/tokenzr.h>
|
||||||
|
|
||||||
BOOLEAN xvt_mail_send(const char* to, const char* cc, const char* ccn,
|
BOOLEAN xvt_mail_send(const char* to, const char* cc, const char* ccn,
|
||||||
const char* subject, const char* msg,
|
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(";"));
|
wxStringTokenizer tokTo(to, _T(";"));
|
||||||
wxMailMessage Msg(subject, tokTo.GetNextToken(), msg);
|
wxMailMessage Msg(subject, tokTo.GetNextToken(), msg);
|
||||||
|
|
||||||
|
if (flags & 0x2)
|
||||||
|
Msg.m_query_receipt = true;
|
||||||
|
|
||||||
while (tokTo.HasMoreTokens())
|
while (tokTo.HasMoreTokens())
|
||||||
Msg.AddTo(tokTo.GetNextToken());
|
Msg.AddTo(tokTo.GetNextToken());
|
||||||
if (Msg.m_to[0].IsEmpty())
|
if (Msg.m_to[0].IsEmpty())
|
||||||
{
|
{
|
||||||
Msg.m_to[0] = " "; // Il destinatario "" fa piantare MAPI con errore 25
|
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)
|
if (attach && *attach)
|
||||||
@ -43,7 +47,7 @@ BOOLEAN xvt_mail_send(const char* to, const char* cc, const char* ccn,
|
|||||||
|
|
||||||
xvt_fsys_save_dir();
|
xvt_fsys_save_dir();
|
||||||
wxEmail Mail;
|
wxEmail Mail;
|
||||||
BOOLEAN ok = Mail.Send(Msg, wxEmptyString, ui != 0);
|
BOOLEAN ok = Mail.Send(Msg, wxEmptyString, ui);
|
||||||
xvt_fsys_restore_dir();
|
xvt_fsys_restore_dir();
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user