开发者

send email from specific ip address

I want to know if there is a option in php or .net to sa开发者_JAVA百科y from which ip address we can send out email. We have couple ip addresses on one of our servers and we don't want to send the emails from the default ip, instead we want to send them from the other ip. Thanks in advance.


PHP can't control the outgoing IP, since it's not acting as a mail server. the mail() function simply connects to whatever SMTP server is specified in php.ini and hands the mail over for the SMTP server to handle.

You can certainly tell the SMTP server which IPs it should bind to, here's how for Postfix. If your website's on a.b.c.d, you want emails to appear from e.f.g.h, then tell Postfix (or whatever server you're using) bind to e.f.g.h and 127.0.0.1.

And of course, you could always run the SMTP software on a completely seperate server as well.


It is controlled by the operating system, not php.

Do you have a SMTP server you can use? That way you will be sure it isn't being sent from a webserver IP address.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜