【发布时间】:2020-02-04 19:46:27
【问题描述】:
我有一个非常简单的前端表单,已成功发送给自己,但我不知道如何将副本发送到用户提供的电子邮件地址。
我是否认为我需要向控制器添加一个数组以使用户通过电子邮件发送一个对象,以便我能够将其发送给他们?
我的 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')->send(new NewContactRequest($all_arrray));
任何人都可以提供的任何帮助都会很棒。
谢谢
【问题讨论】:
标签: php jquery laravel controller