要配置一个postfix发邮件,需要以 xx@test.aslibra.com 发送邮件
同时提供smtp服务给局域网其它服务器提供发送邮件服务
安装好postfix后,可以参考如下配置文件(去掉注释内容):
/etc/postfix/main.cf
PHP发送邮件可以使用phpmailer
扩展阅读:
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
原创内容如转载请注明:来自 阿权的书房
同时提供smtp服务给局域网其它服务器提供发送邮件服务
安装好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
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();
$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
原创内容如转载请注明:来自 阿权的书房
收藏本文到网摘
17huoyuan
2012/04/03 10:43
有编译安装postfix的方法吗
分页: 1/1
1
1
redhat ssh 免密码登录设置后还是提示需要输入密码
NSDictionary的遍历
