网站应用里面的邮件发送,需要在本地安装postfix等等邮件服务器吗?
网站应用里面的邮件发送,需要在本地安装postfix等等邮件服务器吗?
Lamson 这种web application级别的邮件服务器,还需要在本机安装和设置底层的邮件服务器吗?
问题补充:
Postfix主配置设定:
cat /etc/postfix/main.cf
myhostname = mail.haiyun.me #Mail服务器域名,EHLO名称。
mydomain = www.haiyun.me #
myorigin = $mydomain #发信地址,此设置显示为@www.haiyun.me。
inet_interfaces = all #如对外提供MTA服务设置为监听所有网卡,默认只监听本地。
inet_protocols = all #支持协议,可选IPV4/IPV6。
mydestination = $mydomain $myhostname #本地邮件域名,直接接收
mynetworks_style = subnet #允许转发的来源网段,可选subnet子网,class网段,host本机
mynetworks = 192.168.1.0/24,127.0.0.0/8 #允许转发的来源IP,设置后忽略mynetworks_style参数
relay_domains = $mydestination #允许转发的目标域
smtpd_banner = $myhostname ESMTP "Mail Server" #自定服务器信息
参考自: http://www.haiyun.me/archives/centos-install-postfix.html
我打算在自己的ubuntu上面架设postfix服务器(好像已经安装好了),向外面发送邮件。带有“服务器域名”或者“域名”的地方我该怎么填写呀?
既没有空间,也没有域名。只是架设在本地机器上面,收发邮件而已。(满足发邮件即可)。
======================
安装启动postfix
1.用mail命令行工具发送邮件到163邮件可以收到
2.用python - stmplib 使用 localhost发送,163邮箱收到的邮件内容是这样的:
@163.com>: host 163mx02.mxmail.netease.com[220.181.14.155] said: 553
Requested action not taken: no smtp MX
only,mx35,VcCowED5YFRoc8JUnl9+Dg--.38S2 1422029672 (in reply to MAIL FROM
command)
代码:`
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import os
def sendMail(to, fro, subject, text, files=[],server="localhost"):
msg = MIMEText("""
I have been playing with Postfix for the last couple of days. I have already posted a perfect php class for sending email with attachments in a previous post. The Python example I posted earlier does the job for me but it was not perfect like the php one.
""")
msg['From'] = fro
msg['To'] = to
msg['Subject'] = subject
smtp = smtplib.SMTP(server)
smtp.sendmail(fro, to, msg.as_string() )
smtp.close()`
唐伯虎点雷管
10 years, 10 months ago