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
54 lines
1.2 KiB
C++
Executable File
54 lines
1.2 KiB
C++
Executable File
#include "wxinc.h"
|
|
#include "xvt.h"
|
|
|
|
#include "email.h"
|
|
#include <wx/tokenzr.h>
|
|
|
|
BOOLEAN xvt_mail_send(const char* to, const char* cc, const char* ccn,
|
|
const char* subject, const char* msg,
|
|
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
|
|
}
|
|
|
|
if (attach && *attach)
|
|
{
|
|
wxStringTokenizer tokAttach(attach, _T(";"));
|
|
while (tokAttach.HasMoreTokens())
|
|
Msg.AddAttachment(tokAttach.GetNextToken());
|
|
}
|
|
|
|
if (cc && *cc)
|
|
{
|
|
wxStringTokenizer Tok(cc, _T(";"));
|
|
while (Tok.HasMoreTokens())
|
|
Msg.AddCc(Tok.GetNextToken());
|
|
}
|
|
|
|
if (ccn && *ccn)
|
|
{
|
|
wxStringTokenizer Tok(ccn, _T(";"));
|
|
while (Tok.HasMoreTokens())
|
|
Msg.AddBcc(Tok.GetNextToken());
|
|
}
|
|
|
|
xvt_fsys_save_dir();
|
|
wxEmail Mail;
|
|
BOOLEAN ok = Mail.Send(Msg, wxEmptyString, ui);
|
|
xvt_fsys_restore_dir();
|
|
|
|
return ok;
|
|
} |