Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] 无法使用以Sendgrid的API方式发送邮件 #2297

Closed
iampandora opened this issue Nov 15, 2023 · 1 comment
Closed

[BUG] 无法使用以Sendgrid的API方式发送邮件 #2297

iampandora opened this issue Nov 15, 2023 · 1 comment

Comments

@iampandora
Copy link

iampandora commented Nov 15, 2023

Environment 环境

OS: CentOS 9 Stream
HTTPS enabled: YES
PHP version: 8.2.9
DB version: mariadb 10.11.5
Redis version: 7.0.12
Commit:
SSPanel版本为:2023.6 -----(没记错的话)

Bug Info
配置好Sendgrid 密钥、发信地址、发件人信息后,测试发信时,提示:"测试邮件发送失败 Call to undefined function SendGrid\readlink()"
同时服务器日志显示:
Nov 15 15:20:23 XX CROND[1261035]: (root) CMDOUT (Send Node Online Email to admin user)
Nov 15 15:20:23 XX CROND[1261035]: (root) CMDOUT (PHP Fatal error: Uncaught Error: Call to undefined function SendGrid\readlink() in /data/wwwroot/XXX.xyz/vendor/sendgrid/php-http-client/lib/Client.php:399)
Nov 15 15:20:23 XX CROND[1261035]: (root) CMDOUT (Stack trace:)
Nov 15 15:20:23 XX CROND[1261035]: (root) CMDOUT (#0 /data/wwwroot/XXX.xyz/vendor/sendgrid/php-http-client/lib/Client.php(501): SendGrid\Client->createCurlOptions())
Nov 15 15:20:23 XX CROND[1261035]: (root) CMDOUT (#1 /data/wwwroot/XXX.xyz/vendor/sendgrid/php-http-client/lib/Client.php(648): SendGrid\Client->makeRequest())
Nov 15 15:20:23 XX CROND[1261035]: (root) CMDOUT (#2 /data/wwwroot/XXX.xyz/vendor/sendgrid/sendgrid/lib/BaseSendGridClientInterface.php(63): SendGrid\Client->__call())
Nov 15 15:20:23 XX CROND[1261035]: (root) CMDOUT (#3 /data/wwwroot/XXX.xyz/src/Services/Mail/SendGrid.php(53): BaseSendGridClientInterface->send())
Nov 15 15:20:23 XX CROND[1261035]: (root) CMDOUT (#4 /data/wwwroot/XXX.xyz/src/Services/Mail.php(63): App\Services\Mail\SendGrid->send())
Nov 15 15:20:23 XX CROND[1261035]: (root) CMDOUT (#5 /data/wwwroot/XXX.xyz/src/Services/Notification.php(29): App\Services\Mail::send())
Nov 15 15:20:23 XX CROND[1261035]: (root) CMDOUT (#6 /data/wwwroot/XXX.xyz/src/Services/Cron.php(146): App\Services\Notification::notifyAdmin())
Nov 15 15:20:23 XX CROND[1261035]: (root) CMDOUT (#7 /data/wwwroot/XXX.xyz/src/Command/Cron.php(49): App\Services\Cron::detectNodeOffline())
Nov 15 15:20:23 XX CROND[1261035]: (root) CMDOUT (#8 /data/wwwroot/XXX.xyz/xcat(50): App\Command\Cron->boot())
Nov 15 15:20:23 XX CROND[1261035]: (root) CMDOUT (#9 {main})
Nov 15 15:20:23 XX CROND[1261035]: (root) CMDOUT ( thrown in /data/wwwroot/XXX.xyz/vendor/sendgrid/php-http-client/lib/Client.php on line 399)
Nov 15 15:20:23 XX CROND[1261035]: (root) CMDEND (/usr/local/php/bin/php /data/wwwroot/XXX.xyz/xcat Cron)

Describe the issue you run into. 请描述你遇到的问题。
无法通过Sendgrid的API模式发送邮件,如果需要更多信息,可以留言,我尽快补充。

@AutisticShark AutisticShark closed this as not planned Won't fix, can't repro, duplicate, stale Nov 17, 2023
@IAmMasterCraft
Copy link

image

@iampandora the readlink() method is a global in-built php function, but sometimes some server disable it. This error occurs because the readlink() function is not available for use on your server.
To fix this issue try the following:

  • check if your server has a section for disabled php functions then check for the readlink() function name and remove it from there
  • contact your hosting provider for tech support to enable the readlink() function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants