projects
/
squirrelmail.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Happy New Year
[squirrelmail.git]
/
functions
/
compose.php
diff --git
a/functions/compose.php
b/functions/compose.php
index d6aebba31dbeb9dd80dfa016c603429e06bcc672..4c3da837c3566a36181d654981e8578f7436d559 100644
(file)
--- a/
functions/compose.php
+++ b/
functions/compose.php
@@
-6,7
+6,7
@@
* Functions for message compositon: writing a message, attaching files etc.
*
* @author Thijs Kinkhorst <kink at squirrelmail.org>
* Functions for message compositon: writing a message, attaching files etc.
*
* @author Thijs Kinkhorst <kink at squirrelmail.org>
- * @copyright 1999-20
15
The SquirrelMail Project Team
+ * @copyright 1999-20
20
The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @package squirrelmail
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @package squirrelmail
@@
-82,15
+82,27
@@
function sq_get_attach_tempfile()
* or Sendmail. If this parameter is non-
* empty, all other parameters are ignored.
* (OPTIONAL: default is empty)
* or Sendmail. If this parameter is non-
* empty, all other parameters are ignored.
* (OPTIONAL: default is empty)
+ * @param boolean $only_build_message_object When TRUE, only builds the
+ * message object that it
+ * intends to send and returns
+ * it (returned success code
+ * will be -1 and message ID
+ * emtpy) (OPTIONAL; default
+ * is FALSE)
*
*
- * @return array A t
wo
-element array, the first element being a
+ * @return array A t
hree
-element array, the first element being a
* boolean value indicating if the message was successfully
* boolean value indicating if the message was successfully
- * sent or not,
and
the second element being the message's
+ * sent or not, the second element being the message's
* assigned Message-ID, if available (only available as of
* assigned Message-ID, if available (only available as of
- * SquirrelMail 1.4.14 and 1.5.2)
+ * SquirrelMail 1.4.14 and 1.5.2), and the third element
+ * being the message object itself.
+ * If $only_build_message_object is TRUE, only the third
+ * element is useful; first two should be ignored - the
+ * message is never sent in this case.
*
*/
*
*/
-function sq_send_mail($to, $subject, $body, $from, $cc='', $bcc='', $message='')
+function sq_send_mail($to, $subject, $body, $from, $cc='', $bcc='',
+ $message='', $only_build_message_object=FALSE)
{
require_once(SM_PATH . 'functions/mime.php');
{
require_once(SM_PATH . 'functions/mime.php');
@@
-122,6
+134,10
@@
function sq_send_mail($to, $subject, $body, $from, $cc='', $bcc='', $message='')
//sm_print_r($message);exit;
//sm_print_r($message);exit;
+ if ($only_build_message_object)
+ return array(-1, '', $message);
+
+
global $useSendmail;
global $useSendmail;
@@
-131,7
+147,7
@@
function sq_send_mail($to, $subject, $body, $from, $cc='', $bcc='', $message='')
require_once(SM_PATH . 'class/deliver/Deliver_SMTP.class.php');
$deliver = new Deliver_SMTP();
global $smtpServerAddress, $smtpPort, $pop_before_smtp,
require_once(SM_PATH . 'class/deliver/Deliver_SMTP.class.php');
$deliver = new Deliver_SMTP();
global $smtpServerAddress, $smtpPort, $pop_before_smtp,
- $domain, $pop_before_smtp_host;
+ $domain, $pop_before_smtp_host
, $smtp_stream_options
;
$authPop = (isset($pop_before_smtp) && $pop_before_smtp) ? true : false;
if (empty($pop_before_smtp_host)) $pop_before_smtp_host = $smtpServerAddress;
$authPop = (isset($pop_before_smtp) && $pop_before_smtp) ? true : false;
if (empty($pop_before_smtp_host)) $pop_before_smtp_host = $smtpServerAddress;
@@
-139,7
+155,7
@@
function sq_send_mail($to, $subject, $body, $from, $cc='', $bcc='', $message='')
$pass = '';
get_smtp_user($user, $pass);
$stream = $deliver->initStream($message,$domain,0,
$pass = '';
get_smtp_user($user, $pass);
$stream = $deliver->initStream($message,$domain,0,
- $smtpServerAddress, $smtpPort, $user, $pass, $authPop, $pop_before_smtp_host);
+ $smtpServerAddress, $smtpPort, $user, $pass, $authPop, $pop_before_smtp_host
, $smtp_stream_options
);
} else {
require_once(SM_PATH . 'class/deliver/Deliver_SendMail.class.php');
global $sendmail_path, $sendmail_args;
} else {
require_once(SM_PATH . 'class/deliver/Deliver_SendMail.class.php');
global $sendmail_path, $sendmail_args;
@@
-167,7
+183,7
@@
function sq_send_mail($to, $subject, $body, $from, $cc='', $bcc='', $message='')
$success = $deliver->finalizeStream($stream);
}
$success = $deliver->finalizeStream($stream);
}
- return array($success, $message_id);
+ return array($success, $message_id
, $message
);
}
}