|
@@ -134,6 +134,13 @@ class CMailFile
|
|
|
dol_syslog("CMailFile::CMailfile: MAIN_MAIL_SENDMODE=".$conf->global->MAIN_MAIL_SENDMODE." charset=".$conf->file->character_set_client." from=$from, to=$to, addr_cc=$addr_cc, addr_bcc=$addr_bcc, errors_to=$errors_to, trackid=$trackid", LOG_DEBUG);
|
|
|
dol_syslog("CMailFile::CMailfile: subject=$subject, deliveryreceipt=$deliveryreceipt, msgishtml=$msgishtml", LOG_DEBUG);
|
|
|
|
|
|
+ if (empty($subject))
|
|
|
+ {
|
|
|
+ dol_syslog("CMailFile::CMailfile: Try to send an email with empty subject");
|
|
|
+ $this->error='ErrorSubjectIsRequired';
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
// Detect if message is HTML (use fast method)
|
|
|
if ($msgishtml == -1)
|
|
|
{
|
|
@@ -436,8 +443,7 @@ class CMailFile
|
|
|
{
|
|
|
// Send mail method not correctly defined
|
|
|
// --------------------------------------
|
|
|
-
|
|
|
- return 'Bad value for MAIN_MAIL_SENDMODE constant';
|
|
|
+ $this->error = 'Bad value for MAIN_MAIL_SENDMODE constant';
|
|
|
}
|
|
|
|
|
|
}
|