|
From: FlorinCB <ory...@us...> - 2009-10-23 07:46:58
|
Update of /cvsroot/mxbb/mx_contact/includes In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv23497/mx_contact/includes Modified Files: contact_emailer.php Log Message: some fixed here and there not comitted Index: contact_emailer.php =================================================================== RCS file: /cvsroot/mxbb/mx_contact/includes/contact_emailer.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** contact_emailer.php 4 Oct 2008 07:44:53 -0000 1.2 --- contact_emailer.php 23 Oct 2009 07:46:43 -0000 1.3 *************** *** 80,83 **** --- 80,89 ---- $this->subject = trim(preg_replace('#[\n\r]+#s', '', $subject)); } + + // set up skip mail + function email_skip($email_skip = false) + { + $this->email_skip = $email_skip; + } // set up extra mail headers *************** *** 203,209 **** $to = $this->addresses['to']; - $cc = (count($this->addresses['cc'])) ? implode(', ', $this->addresses['cc']) : ''; $bcc = (count($this->addresses['bcc'])) ? implode(', ', $this->addresses['bcc']) : ''; // Build header --- 209,215 ---- $to = $this->addresses['to']; $cc = (count($this->addresses['cc'])) ? implode(', ', $this->addresses['cc']) : ''; $bcc = (count($this->addresses['bcc'])) ? implode(', ', $this->addresses['bcc']) : ''; + $skip = ($this->email_skip == $this->addresses['to']) ? true : false; // Build header *************** *** 225,229 **** } ! $result = smtpmail($to, $this->subject, $this->msg, $this->extra_headers); } else --- 231,235 ---- } ! $result = ($skip) ? false : smtpmail($to, $this->subject, $this->msg, $this->extra_headers); } else *************** *** 232,236 **** $to = ($to == '') ? (($board_config['sendmail_fix']) ? ' ' : 'Undisclosed-recipients:;') : $to; ! $result = mail($to, $this->subject, preg_replace("#(?<!\r)\n#s", "\n", $this->msg), $this->extra_headers); if (!$result && !$board_config['sendmail_fix'] && $empty_to_header) --- 238,242 ---- $to = ($to == '') ? (($board_config['sendmail_fix']) ? ' ' : 'Undisclosed-recipients:;') : $to; ! $result = ($skip) ? false : mail($to, $this->subject, preg_replace("#(?<!\r)\n#s", "\n", $this->msg), $this->extra_headers); if (!$result && !$board_config['sendmail_fix'] && $empty_to_header) *************** *** 262,274 **** $board_config['sendmail_fix'] = 1; ! $result = mail($to, $this->subject, preg_replace("#(?<!\r)\n#s", "\n", $this->msg), $this->extra_headers); } } // Did it work? ! if (!$result) { mx_message_die(GENERAL_ERROR, 'Failed sending email :: ' . (($this->use_smtp) ? 'SMTP' : 'PHP') . ' :: ' . $result, '', __LINE__, __FILE__); } return true; --- 268,285 ---- $board_config['sendmail_fix'] = 1; ! $result = ($skip) ? false : mail($to, $this->subject, preg_replace("#(?<!\r)\n#s", "\n", $this->msg), $this->extra_headers); } } // Did it work? ! if ((!$result) && (!$skip)) { mx_message_die(GENERAL_ERROR, 'Failed sending email :: ' . (($this->use_smtp) ? 'SMTP' : 'PHP') . ' :: ' . $result, '', __LINE__, __FILE__); } + + if (!$skip) + { + print_r('Failed sending email :: Use another adress for sender.', __LINE__, __FILE__); + } return true; |