Archive for 九月, 2013

memcached限制ip进行tcp连接

先说下-l绑定本机网卡的问题,当使用-l 127.0.0.1运行md的时候,只有本机能connect上这个memcache;让使用-l 10.0.0.2运行的时候(这里假定10.0.0.2是md机器对外的ip),任何机器都可以连上这个memcache。同事有人指出,-l实际上就是在指定绑定机器的那个网卡的问题,比如当使用ifconfig的时候,显示信息类似如下: (continue reading…)


link 忽略access

config.typolinkLinkAccessRestrictedPages = NONE

mail with image CID

Global:

$mail = t3lib_div::makeInstance('t3lib_mail_Message');
            $mail->setFrom(array($sender => $sender_name));
            $mail->setReplyTo($reply_to);
            $mail->setTo($row['email']);
            $mail->setSubject($subject);

            $body = 'Any html code!';

            preg_match_all("/\embed(Swift_Image::fromPath($src));
                    if($cid){
                        $body = str_replace($src, $cid, $body);
                    }
                }
            }
            $mail->setBody($body, 'text/html', 'utf-8');
            $mail->send();

typo3<4.7 [4.7+己废弃]

require_once(PATH_t3lib.’class.t3lib_htmlmail.php’);

// Prepare mailer and send the mail
$mailer = t3lib_div::makeInstance(‘t3lib_htmlmail’);
$mailer->start();
$mailer->useBase64();
$mailer->from_email = ”;
$mailer->from_name = ”;
$mailer->charset = ‘iso-8859-1′;
//$mailer->replyto_email = $this->reply_email;
//$mailer->replyto_name = ‘TEST-TASK’;
$mailer->subject = ”;
//$mailer->addPlain($mailBody);
$mailer->addHTML($url); //支持图片CID
$mailer->setRecipient(recipient@email.com);
$mailer->setHeaders();
$mailer->setContent();
$mailer->sendtheMail();

Copyright © 1996-2010 Add Lives. All rights reserved.
iDream theme by Templates Next | Powered by WordPress