我的邮件脚本在sendmails.php文件中。那么,在使用java脚本提交页面之前,我可以发送一个ajax请求来发送邮件吗?如下所示
function submit_page()
{
//trying to run send_mail.php
..............................//ajax codes
............................
xmlhttp.open("GET","send_mail.php",true);
xmlhttp.send();
...............................
我们正试图用PHP框架发送大量电子邮件(100 K)。哪种方式是正确的方式发送大量电子邮件与拉拉维尔队列?
案例1。
//controller
public function runQueue(){
dispatch(new ShootEmailJob());
}
//job
public function handle(){
$emails = EmailList::get(['email']);
foreach($emails as $email){
Mail::to($email)->se
我想知道是否有办法在php中启动一个单独的线程来发送和发送电子邮件。我有一个小的web服务,它从iPad应用程序中获取一些信息,然后将数据插入到数据库中,然后发送电子邮件。问题是,有时发送电子邮件的时间太长,导致iPad的请求超时。有没有办法让我分开发邮件?我基本上是想在电子邮件发送之前告诉iPad一切都成功了。
一些示例代码:
... Process info and insert into DB
echo "success"; //this should be returned to the iPad right away.
//start new thread here