php mail to 配置详解

yipeiwu_com6年前PHP代码库
复制代码 代码如下:

[mail function]
; For Win32 only.
SMTP = mail3.focuschina.com
smtp_port = 25

; For Win32 only.
;sendmail_from = me@example.com

仅仅配置了如上的代码,没有用到用户名和密码,测试代码成功发送邮件
好读书,不求甚解。。以上

发送的测试代码:
复制代码 代码如下:

<?php

[php] view plaincopyprint?在CODE上查看代码片派生到我的代码片

$subject = iconv('UTF-8', 'GBK', "邮件标题");
$message = iconv('UTF-8', 'GBK', "邮件内容发打发打发fasdfadsfasdf");
$from ='OA<noreply@made-in-china.com>';
$from = iconv('UTF-8', 'GBK', $from);
$headers = "From: " . $from . "\nContent-Type: text/html; charset=GBK; MIME-Version: 1.0'\n";
$to="xuedagong@163.com";
if(mail($to, $subject, $message,$headers)){
echo "Ok.";
}else{
echo "Fail.";
}

相关文章

php正则提取html图片(img)src地址与任意属性的方法

简单版: <?php header("Content-Type: text/html;charset=utf-8"); $str = '<div class="...

php设计模式 Delegation(委托模式)

复制代码 代码如下: <?php /** * 委托模式 示例 * * @create_date: 2010-01-04 */ class PlayList { var $_song...

php socket通信(tcp/udp)实例分析

本文实例讲述了php socket通信(tcp/udp)方法。分享给大家供大家参考,具体如下: 注意 1.在socket_bind的时候ip地址不能真回环地址如127.0.0.1 2.s...

php使用QueryList轻松采集js动态渲染页面方法

QueryList使用jQuery的方式来做采集,拥有丰富的插件。下面来演示QueryList使用PhantomJS插件抓取JS动态创建的页面内容。 一、安装 使用Composer安装:...

Ajax+Jpgraph实现的动态折线图功能示例

Ajax+Jpgraph实现的动态折线图功能示例

本文实例讲述了Ajax+Jpgraph实现的动态折线图功能。分享给大家供大家参考,具体如下: 一 代码 fun.js: var i=1; function progress(){...