分享

写回答

发帖

[提问] 如何使用smtp发邮件呢

回答|共 12 个

add.c

发表于 2010-6-28 14:36:19 | 显示全部楼层

回复 10# 的帖子

把域名的MX记录设置为
MX 0 - smtp.secureserver.net.
MX 10 - mailstore1.secureserver.net.
php函数一直发送正常, 不过qq等国内邮箱可能收不到

orton

发表于 2010-6-28 14:50:09 | 显示全部楼层

斑竹我的邮件类里面有个这样的你看一下
        function smtp($relay_host = "", $smtp_port = 25,$auth = false,$user,$pass){       
                $this->debug = FALSE;
                $this->smtp_port = $smtp_port;
                $this->relay_host = $relay_host;
                $this->time_out = 30; //is used in fsockopen()
                #
                $this->auth = $auth;//auth
                $this->user = $user;
                $this->pass = $pass;
                #
这里  这里 这里 这里 这里 这里 这里$this->host_name = "relay-hosting.secureserver.net"; 这个地址对么?
                $this->log_file ="";
               
                $this->sock = FALSE;
        }

add.c

发表于 2010-6-28 14:58:33 | 显示全部楼层

可以 .
php函数设置应该很简单呀,代码如下
<?php
$to= ‘收件邮箱’;
$subject = ‘the subject’;
$message = ‘hello’;
$headers = ‘From:发件邮箱’. “\r\n” .
    ‘Reply-To:抄送到的邮箱’ . “\r\n” .
    ‘X-Mailer: PHP/’ . phpversion();

mail($to, $subject, $message, $headers);
?>
您需要登录后才可以回帖 登录 | 注册

本版积分规则