首页 > 解决方案 > 在 SMTP 连接之前更改服务器 IP

问题描述

我尝试使用 SMTP PHP 验证电子邮件。现在它工作正常。我想在连接到 SMTP 之前更改我的服务器 IP。现在默认情况下,它需要我的主 IP 运行,但我想在服务器的辅助 IP 中运行。如何使用 PHP 更改服务器 IP?

当前代码:

if ($this->sock = fsockopen($host, $this->port, $errno, $errstr, (float) $timeout)) {
    stream_set_timeout($this->sock, $this->max_read_time);
    break;
}

标签: phpvalidationemailsmtpip

解决方案


推荐阅读