邮件未在Mac Book pro中发送xampp [复制](mail not sent form xampp in MAC Book pro [duplicate])

编程入门 行业动态 更新时间:2024-10-24 14:26:04
邮件未在Mac Book pro中发送xampp [复制](mail not sent form xampp in MAC Book pro [duplicate])

这个问题在这里已有答案:

PHP邮件功能没有完成发送电子邮件 24个答案

我有这个代码使用smtp发送电子邮件,我得到输出 - 使用以下代码成功发送邮件

ini_set('SMTP', 'mail.veshraj.com.np'); ini_set('smtp_port', 465); $message = "Hi \n How are you."; if(mail('veshraj.joshi1@gmail.com', 'Testing Subject for mail function', $message)) { echo 'Mail sent successfully'; }

但我没有收到任何电子邮件,这个代码是在本地机器上; 如果在localhost中不支持smtp - 那么框架就像laravel,yii这样做了

This question already has an answer here:

PHP mail function doesn't complete sending of e-mail 27 answers

I have this code to send email using smtp, and i got output- Mail sent successfully with following code

ini_set('SMTP', 'mail.veshraj.com.np'); ini_set('smtp_port', 465); $message = "Hi \n How are you."; if(mail('veshraj.joshi1@gmail.com', 'Testing Subject for mail function', $message)) { echo 'Mail sent successfully'; }

But I did not receive any email, this code is in local machine; If smtp not supported in localhost - then how did frameworks like laravel,yii to do so

最满意答案

您是对的,您不能使用XAMMP在本地主机上发送邮件。 您需要在可以发送邮件的服务器上工作,例如EC2实例。 查看: https : //laravel.com/docs/5.0/mail ,了解他们如何配置邮件。

它们提供了如何将电子邮件发送到日志而不是收件人的信息。

You are right that you can't send mail on your local host with XAMMP. You need to work on a server that can send mail such as an EC2 instance. Check out: https://laravel.com/docs/5.0/mail and read about how they configure their mail.

They give information how how to send emails to logs instead of recipients as well.

更多推荐

本文发布于:2023-04-27 20:36:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1329074.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:邮件   Book   pro   xampp   Mac

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!