Php 从表单Laravel向用户发送确认电子邮件

Php 从表单Laravel向用户发送确认电子邮件,php,jquery,laravel,controller,Php,Jquery,Laravel,Controller,我有一个非常简单的前端表单,我正在成功地发送给自己,但我不知道如何将副本发送到用户提供的电子邮件地址 我是否正确地认为我需要向控制器添加一个数组,以使用户电子邮件成为我能够向他们发送此邮件的对象 我的HMTL表格: <div class="tab-content"> <div class="tab-pane" id="about"> <div class="row"> <h4 class="info-tex

我有一个非常简单的前端表单,我正在成功地发送给自己,但我不知道如何将副本发送到用户提供的电子邮件地址

我是否正确地认为我需要向控制器添加一个数组,以使用户电子邮件成为我能够向他们发送此邮件的对象

我的HMTL表格:

<div class="tab-content">
    <div class="tab-pane" id="about">
        <div class="row">
            <h4 class="info-text"> Tell us about yourself and the project you are working on.</h4>
            <div class="col-sm-5 col-sm-offset-1">
                <div class="form-group">
                    <label><b>Contact Name</b> <small></small></label>
                    <input name="name" type="text" class="form-control" placeholder="Contact Name..." id="name" required>
                </div>
                <div class="form-group">
                    <label><b>Company</b><small></small></label>
                    <input name="company" type="text" class="form-control" placeholder="Company Name..." id="company" required>
                </div>
                <div class="form-group">
                    <label><b>Contact Number</b> <small></small></label>
                    <input name="phone" type="number" class="form-control" minlength="10" maxlength="15" placeholder="Number..." id="number" required>
                </div>
            </div>
            <div class="col-sm-5 ">
                <div class="form-group">
                    <label for="project"><b>Please tell us a little about the project you are working on</b> <small></small></label>
                    <textarea class="form-control" minlength="15" maxlength="255" name="project" rows="9" id="project" placeholder="Please enter project and building name..." required></textarea>
                </div>
            </div>
            <div class="col-sm-10 col-sm-offset-1">
                <div class="form-group">
                    <label><b>Email </b><small></small></label>
                    <input name="email" type="email" class="form-control" placeholder="email@email.com" id="email" required>
                </div>
            </div>
        </div>
    </div>
任何人能给予的任何帮助都将是伟大的

谢谢

是的

您可以将抄送添加到邮件功能中

Mail::to('builder.enquiries@gmail.com')
    ->cc(['abc@exabc.com','def@exabc.com'])
    ->send(new NewContactRequest($all_arrray));

希望这对您有所帮助。

我可以用它来添加用户输入的电子邮件地址,例如:Mail::to('builder)。enquiries@gmail.com“)->cc([$email])->send(NewContactRequest($all_array));谢谢你的帮助$电子邮件=['email1@abc.com','email1@abc.com']; 邮件::发送到('builder)。enquiries@gmail.com)->cc($email)->send(新建联系人请求($all_array));
Mail::to('builder.enquiries@gmail.com')
    ->cc(['abc@exabc.com','def@exabc.com'])
    ->send(new NewContactRequest($all_arrray));