"smtp.ym.163.com"," "port"=">25," "auth"=">true," "username"=">$from," "password"=">$password," "from"=">$from," );="" $hdrs="array(" 'from'=">$from," 'to'=">" $to,="" 收信地址="" 'subject'=">$mailsubject" $mime="new" mail_mime();="" $mime->settxtbody($text);="" 添加附件="" $mime->addhtmlimage('php.gif','image="" gif','12345',true);="" $mime->_build_params['html_charset']="utf-8" 设置编码格式="" $mime->_build_params['head_charset']="utf-8" $mime->sethtmlbody($mailbody);="" $body="$mime->get();" $mail="Mail::factory('smtp',$mail_config);" $succ="$mail->send($to,$hdrs,$body);" if="" (pear::iserror($succ))="" {="" echo="" 'email="" sending="" failed:="" '="" .="" $succ->getmessage();="" $err="Email sending failed: " $content="$to."\\t".date('Y-m-d" h:i:s')."\\t="" ".$err."="" \\r\\n"="" }="" else="" email="" sent="" succesfully="" return="" true;="" 该片段来自于http:="" www.codesnippet.cn="" detail="" 191220138165.html="" <="" pre="" class=" prettyprint linenums prettyprinted">
来源: http://www.codesnippet.cn/detail/191220138165.html