Patch level : 12.0 nopatch

Files correlati     :
Commento        :

aggiunta possibilità di mettere in Ccn nelle mail l'indirizzo del mittente
This commit is contained in:
smen 2021-10-26 11:55:41 +02:00
parent 626b5d84da
commit 3bfa1d0bb1

View File

@ -57,6 +57,11 @@ static bool has_power_mail()
return GetMailParam("Powershell") == "X"; return GetMailParam("Powershell") == "X";
} }
static bool has_ccnsend()
{
return GetMailParam("CcnSend") == "X";
}
short xvt_mail_installed() short xvt_mail_installed()
{ {
short bInstalled = 0; short bInstalled = 0;
@ -339,7 +344,7 @@ BOOLEAN xvt_powermail_send(const char* to, const char* cc, const char* ccn,
*/ */
wxStringTokenizer portTok(port, " "); wxStringTokenizer portTok(port, " ");
wxString port_number; wxString port_number;
bool ssl = false, hasccn = ccn && *ccn, hascc = cc && *cc; bool ssl = false, hasccn = ccn && *ccn, hascc = cc && *cc;
while(portTok.HasMoreTokens()) while(portTok.HasMoreTokens())
{ {
@ -373,6 +378,7 @@ BOOLEAN xvt_powermail_send(const char* to, const char* cc, const char* ccn,
file.Write("$To = "); file.Write(str_to); file.Write("\n"); file.Write("$To = "); file.Write(str_to); file.Write("\n");
file.Write("$Subject = \""); file.Write(subject); file.Write("\"\n"); file.Write("$Subject = \""); file.Write(subject); file.Write("\"\n");
file.Write("$Body = \""); file.Write(msg); file.Write("\"\n"); file.Write("$Body = \""); file.Write(msg); file.Write("\"\n");
if (hascc) if (hascc)
{ {
wxString str_cc(cc); wxString str_cc(cc);
@ -380,13 +386,14 @@ BOOLEAN xvt_powermail_send(const char* to, const char* cc, const char* ccn,
buildPSArray(str_cc); buildPSArray(str_cc);
file.Write("$CC = "); file.Write(str_cc); file.Write("\n"); file.Write("$CC = "); file.Write(str_cc); file.Write("\n");
} }
if (hasccn)
if (has_ccnsend())
{ {
wxString str_ccn(ccn); wxString str_ccn(from);
buildPSArray(str_ccn);
file.Write("$Bcc = "); file.Write(str_ccn); file.Write("\n");
}
buildPSArray(str_ccn);
file.Write("$Bcc = "); file.Write(str_ccn); file.Write("\n");
}
file.Write( file.Write(
"$message = new-object Net.Mail.MailMessage\n" "$message = new-object Net.Mail.MailMessage\n"
"$message.From = $From\n" "$message.From = $From\n"
@ -402,14 +409,15 @@ BOOLEAN xvt_powermail_send(const char* to, const char* cc, const char* ccn,
); );
} }
if (hasccn == true) if (hasccn || has_ccnsend())
{ {
file.Write( file.Write(
"foreach($i in $Bcc)\n" "foreach($i in $Bcc)\n"
"{ $message.Bcc.Add($i)}" "{ $message.Bcc.Add($i)}\n"
); );
} }
file.Write( file.Write(
"$message.Subject = $Subject\n" "$message.Subject = $Subject\n"
"$message.Body = $Body\n" "$message.Body = $Body\n"