
[英]Connect failed: php_network_getaddresses: getaddrinfo failed: System error
[英]Unable to send email using PHPMailer connected with Tor. Getting SMTP ERROR: Failed to connect to server: php_network_getaddresses. How to fix this?
我和我的团队愿意为我们的网站设置一个洋葱地址。
我们可以访问该网站,PHP 运行良好,但我们无法通过 PHPMailer 发送电子邮件。
我们在 php 文件中使用danwin1210作为主机服务器,配置如下:
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require("tools/PHPMailer/src/PHPMailer.php");
require("tools/PHPMailer/src/Exception.php");
require("tools/PHPMailer/src/SMTP.php");
if(!$error){
try {
$email = new PHPMailer;
$email->isSMTP();
$email->SMTPDebug = 2;
$email->Host = 'danielas3rtn54uwmofdo3x2bsdifr47huasnmbgqzfrec5ubupvtpid.onion';
$email->Port = 25;
$email->SMTPAuth = true;
$email->SMTPAutoTLS = false;
$email->Username = "XXXXXX@tt3j2x4k5ycaa5zt.onion";
$email->Password = "XXXXXX";
$email->CharSet = 'utf-8';
$email->setFrom('XXXXXX@tt3j2x4k5ycaa5zt.onion', 'XXXXXX');
...
这是我们得到的错误:
2019-11-18 15:16:38 SMTP ERROR: Failed to connect to server: php_network_getaddresses: getaddrinfo failed: Name or service not known (0)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
有人能告诉我们这是否正确吗? 我们需要在此处或服务器的配置文件中进行更改吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.