Posted on: 10/31/05 03:03pm
By: Flernk
Posted on: 10/31/05 03:20pm
By: Dirk
Posted on: 11/11/05 01:58pm
By: Flernk
Posted on: 11/15/05 03:01pm
By: Flernk
Posted on: 11/15/05 06:32pm
By: Flernk
/** * Send an email. * * All emails sent by Geeklog are sent through this function now. * * @param to string recipients name and email address * @param subject string subject of the email * @param message string the text of the email * @param from string (optional) sender of the the email * @param html bool true if to be sent as an HTML email * @param priority int add X-Priority header, if > 0 * @return boolean true if successful, otherwise false * */ function COM_mail( $to, $subject, $message, $from = '', $html = false, $priority = 0 ) { global $_CONF, $LANG_CHARSET; static $mailobj; if( function_exists( 'CUSTOM_mail' )) { return CUSTOM_mail( $to, $subject, $message, $from, $html, $priority ); } include_once( 'Mail.php' ); include_once( 'Mail/RFC822.php' ); $method = $_CONF['mail_settings']['backend']; if( !isset( $mailobj )) { if(( $method == 'sendmail' ) || ( $method == 'smtp' )) { $mailobj =& Mail::factory( $method, $_CONF['mail_settings'] ); } else { $method = 'mail'; $mailobj =& Mail::factory( $method ); } } if( empty( $LANG_CHARSET )) { $charset = $_CONF['default_charset']; if( empty( $charset )) { $charset = 'iso-8859-1'; } } else { $charset = $LANG_CHARSET; } if( empty( $from )) { $from = COM_formatEmailAddress( $_CONF['site_name'], $_CONF['site_mail']); } $headers = array(); $headers['From'] = $from; if( $method != 'mail' ) { $headers['To'] = $to; } $headers['Date'] = date( 'r' ); // RFC822 formatted date if( $method == 'smtp' ) { list( $usec, $sec ) = explode( ' ', microtime()); $m = substr( $usec, 2, 5 ); $headers['Message-Id'] = '<' . date( 'YmdHis' ) . '.' . $m . '@' . $_CONF['mail_settings']['host'] . '>'; } if( $html ) { $headers['Content-Type'] = 'text/html; charset=' . $charset; $headers['Content-Transfer-Encoding'] = '8bit'; } else { $headers['Content-Type'] = 'text/plain; charset=' . $charset; } $headers['Subject'] = $subject; if( $priority > 0 ) { $headers['X-Priority'] = $priority; } $headers['X-Mailer'] = 'GeekLog ' . VERSION; $retval = $mailobj->send( $to, $headers, $message ); if( $retval !== true ) { COM_errorLog( $retval->toString(), 1 ); } return( $retval === true ? true : false ); }
Posted on: 11/15/05 08:59pm
By: Flernk
if( $html ) { $headers['Content-Type'] = 'text/html; charset=' . $charset; $headers['Content-Transfer-Encoding'] = '8bit'; } else { $headers['Content-Type'] = 'text/plain; charset=' . $charset; }
if( $html ) { $headers['Content-Type'] = 'text/plain; charset=' . $charset; } else { $headers['Content-Type'] = 'text/html; charset=' . $charset; $headers['Content-Transfer-Encoding'] = '8bit'; }
10=> 'HTML'
10=> 'Send as Plain Text (Default is HTML) – Normally, you should select this option.'