How send php mail() to user@domain.com from my linux server when mx is another server
I want to send mail with PHP like this:
mail('user@domain.com','subject','body','');
the 开发者_如何学Cdns config is :
$ttl 86400
domain.com. IN SOA domain.com. postmaster.domain.com. (
2011052404
21600
3600
604800
86400 )
IN NS ksxxxxxx.kimsufi.com.
IN MX 10 mx.online.net.
IN A 11.22.33.44
www IN A 11.22.33.44
dev IN A 11.22.33.44
domain.com. IN MX 20 mx-cache.online.net
The mx is not local, but when I send mail()
, the email arrive in local mailbox.
I used the ini_set("SMTP","mx.online.net" );
but always the same.
Any idea ?
EDIT : It's qmail server.
EDIT2 : I deleted the line domain.com:domain.com in the file /var/qmail/control/virtualdomains, and it seems to be ok.
If you are using sendmail as the mail server on your local machine, then you need to configure your SMTP relay on your machine to forward all mail to your mx server, or some otherr external smtp server.
This is nothing to do with PHP and not much to do with DNS. It's exclusivley about your MTA config - but you've provided no details about this.
when I send mail(), the email arrive in local mailbox
....
ini_set("SMTP","mx.online.net" );
If you're using an SMTP connection from your client then there is no such thing as a 'local mailbox'
精彩评论