我在Laravel中使用SMTP配置了该电子邮件。它的工作正常。
我希望一些用户能够使用自己的电子邮件地址发送电子邮件。
我以前这样做:
Mail::to($receiver)->from("myconfiguredSTMPemail@mycompany.com")->send(new email());
我现在这样做:
Mail::to($receiver)->from($email_given_by_the_user)->send(new email());
这样做很好,但我不喜欢这样的方式,因为实际上是从我的电子邮件发送的,而不是从用户提供的电子邮件发送的,即使最终用户看到的是
$email_given_by_the_user
。我想以myconfiguredSTMPemail@mycompany.com
的形式发送它,但当用户想要回复时,它会回复到$email_given_by_the_user
。有什么办法可以解决这个问题吗?