使用Cpanel部署的Laravel应用邮件发送异常求助
问题详情
我需要在用户提交联系表单时发送两封邮件:一封发送至用户填写的邮箱,另一封发送至我自己的info@my-domain.com邮箱。
当前.env邮件配置
MAIL_MAILER=sendmail MAIL_HOST=smtp.gmail.com MAIL_PORT=465 MAIL_USERNAME=m.s***********@gmail.com MAIL_PASSWORD='************' MAIL_ENCRYPTION=tls MAIL_FROM_ADDRESS=m.s***********@gmail.com MAIL_FROM_NAME="${APP_NAME}"
控制器发送邮件代码
dd($request->email); Mail::to($request->email)->bcc('info@my-domain.com')->send(new ContactSubmit($contact));
现有问题
目前info@my-domain.com能正常接收所有邮件,但其他域名的邮箱无法收到邮件。dd($request->email)输出的用户邮箱地址是正确的。
此前尝试及报错
我曾尝试将自有域名邮箱设为发件地址,修改.env配置如下:
MAIL_FROM_ADDRESS=info@my-domain.com
但发送邮件时收到以下错误:
SMTP error from remote mail server after end of data:
552 5.2.0 xkfupRYgo20R2xkfupkpjt :CPANEL: 该xh********账户的邮件系统访问已因垃圾邮件活动被封禁。检测到该账户及可能运行的其他脚本发送垃圾邮件。如需解决问题,请查看垃圾邮件清理指引。清理完成后,请联系客服解除封禁。
请求(Request)输出信息
Illuminate\Http\Request {#43 ▼ #json: null #convertedFiles: null #userResolver: Closure($guard = null) {#312 ▶} #routeResolver: Closure() {#303 ▶} +attributes: Symfony\Component\HttpFoundation\ParameterBag {#45 ▶} +request: Symfony\Component\HttpFoundation\InputBag {#44 ▼ #parameters: array:6 [▼ "_token" => "BfBF3cKMD2WWYEc1AGHbYgFS1KYo2R6MkIRwTYWH" "name" => "Muhammad Shahzaib" "email" => "shahzaib.example@gmail.com" "phone" => "05000000000" "message" => "Testing" "g-recaptcha-response" => null ] } +query: Symfony\Component\HttpFoundation\InputBag {#51 ▶} +server: Symfony\Component\HttpFoundation\ServerBag {#47 ▶} +files: Symfony\Component\HttpFoundation\FileBag {#48 ▶} +cookies: Symfony\Component\HttpFoundation\InputBag {#46 ▶} +headers: Symfony\Component\HttpFoundation\HeaderBag {#49 ▶} #content: null #languages: null #charsets: null #encodings: null #acceptableContentTypes: null #pathInfo: "/contact-us" #requestUri: "/contact-us" #baseUrl: "" #basePath: null #method: "POST" #format: null #session: Illuminate\Session\Store {#1622 ▶} #locale: null #defaultLocale: "en" -preferredFormat: null -isHostValid: true -isForwardedValid: true -isSafeContentPreferred: null basePath: "" format: "html" }
内容的提问来源于stack exchange,提问作者Muhammad Shahzaib
相关产品推荐
相关产品推荐

