阿里云虚拟主机PHP程序使用fsockopen方式发信代码

作者阿里云代理 文章分类 分类:阿里云虚拟主机11 阅读次数 已被围观
虚拟主机PHP程序使用fsockopen方式发信代码
阿里云虚拟主机PHP程序可以使用fsockopen方式发信,相关程序代码请参考:
 
<?
 
 echo send_mail('此处为收件人邮箱','发信测试','测试测试测试测试测试测试');
 
 function send_mail($to, $subject = 'No subject', $body) {
 
 $loc_host = "test"; //发信计算机名,可随意
 
 $smtp_acc = "test@hichina.com"; //Smtp认证的用户名,类似fuweng@im286.com,或者fuweng
 
 $smtp_pass="test"; //Smtp认证的密码,一般等同pop3密码
 
 $smtp_host="mx.hichina.com"; //SMTP服务器地址,类似 smtp.tom.com
 
 $from="test@hichina.com"; //发信人Email地址,你的发信信箱地址
 
 $headers = "Content-Type: text/plain; charset=\"gb2312\"\r\nContent-Transfer-Encoding: base64";
 
 $lb="\r\n"; //linebreak
 
本公司销售:阿里云、腾讯云、百度云、天翼云、金山大米云、金山企业云盘!可签订合同,开具发票。
?