要配置一个postfix发邮件,需要以 xx@test.aslibra.com 发送邮件
同时提供smtp服务给局域网其它服务器提供发送邮件服务

引用
补充@20140104:
机器的hostname将会是发邮件的后缀,比如是 www.aslibra.com的机器,发邮件是 root@www.aslibra.com
可以把 www.aslibra.com 做别名 到 aslibra.com,域名生效后重启postfix,发邮件就是 root@aslibra.com


安装好postfix后,可以参考如下配置文件(去掉注释内容):

/etc/postfix/main.cf

myhostname = test.aslibra.com
mydomain = test.aslibra.com
mynetworks = 192.168.1.0/24, 127.0.0.0/8
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
myorigin = $myhostname
inet_interfaces = all
unknown_local_recipient_reject_code = 550
relay_domains = $mydestination
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
debug_peer_level = 2
debugger_command =
   PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
   xxgdb $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.3.3/samples
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES


PHP发送邮件可以使用phpmailer

include('libraries/class.phpmailer.php');

$mail = new PHPMailer();  
$mail->CharSet="UTF-8";
$mail->IsSMTP();                            // 经smtp发送  
$mail->Host     = $this->smtp_ip;           // SMTP 服务器  
$mail->SMTPAuth = false;          // 局域网不需要SMTP 认证  
$mail->From     = $from;  // 发信人  
$mail->FromName = $fromuser;        // 发信人别名  
$mail->Sender = $from;

$mail->AddAddress($to);  // 收信人  
if(isset($ccmail)){  
  $mail->AddCC($ccmail);  // cc收信人
}  
if(isset($bccmail)){  
  $mail->AddCC($bccmail);    // bcc收信人
}  

$mail->WordWrap = 50;  
$mail->IsHTML(true);                            // 以html方式发送  
$mail->Subject  = $title;                 // 邮件标题  
$mail->Body     = $content;                    // 邮件内空  

$mail->Send();


扩展阅读:

1 带smtp认证的postfix配置
http://hi.baidu.com/jedibd/blog/item/7b73ab25a7b7e06d35a80f45.html
2 CentOS下(PostFix)SMTP服务器的构建
http://www.fuancn.cn/html/ServerSettings/Linux/CentOS/20084288.html
3 phpmailer,smtp发送邮件实例
http://blog.51yip.com/php/910.html/comment-page-1
4 postfix邮件服务的基本配置
http://eastwalk.blogbus.com/logs/57585048.html
5 Postfix服务的基本配置
http://book.51cto.com/art/200904/118655.htm
6 telnet smtp发邮件
http://hi.baidu.com/guixiao_zhou/blog/item/49f8a73259a9f2210a55a9ec.html
7 簡易 Mail Server 架設 -- Postfix 設定
http://linux.vbird.org/linux_server/0390postfix.php


原创内容如转载请注明:来自 阿权的书房
收藏本文到网摘
Tags: , ,
EssaysService organization Homepage Email
2013/11/26 02:12
Go to click here in order to get  an excellent opportunity to purchase professional custom essay and make a difference in your academic life with the help of our best writing service.
goldessays company Homepage Email
2013/11/26 02:04
Buy a research paper from dependable writing centre and obtain cheap essay writing help. Use the following Web site "goldessays.com" and all your difficulties will fade away.
resume company Homepage Email
2013/07/22 00:26
Are you seeking how to write a resume or where to obtain samples of resume writing and help with resume writing? Or you just wish to order resume from expert resume writers? Only contact Resume company (exclusiveresume.com).
Research Paper Proposal Homepage Email
2013/07/15 14:11
Different people require a long time to get the issue of the custom research paper. But when you don’t have time, it would be better to buy book reports. Then that will be real to save reputation.
LizaCervantes Homepage Email
2013/07/15 14:04
Different people in the world get the <a href="http://goodfinance-blog.com/topics/credit-loans">credit loans</a> from different creditors, just because that is comfortable.
17huoyuan Homepage
2012/04/03 10:43
有编译安装postfix的方法吗
分页: 1/1 第一页 1 最后页
发表评论
AD
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML 打开UBB 打开表情 隐藏
昵称   密码   游客无需密码
网址   电邮   [注册]
               

验证码 不区分大小写
 

阅读推荐

服务器相关推荐

开发相关推荐

应用软件推荐