问题描述
可以通过PHP发送邮件,同时提供实时的用户反馈意见。
Is it possible to send mail asycronously using PHP while giving live user feedback on delivery?
我已经为我们公司的内部网络写了一个小应用程序来发送格式化的电子邮件给客户该界面相当干净,只需输入一个作业号,然后构建并发送邮件。邮件正在建立中,从另一台服务器获取一些附件,一切都是自动化的。使用的库是。
I have recenty written a small app for our company's intranet for sending formatted emails to customers. The interface is quite clean and only requires the input of a job number, it then builds and sends the mail. The mail, while being built, obtains a number of attachments from another server and everything is automated. The library used is PHPMailer.
是否有使用其他技术的方法,可能还是使用PHP作为主要语言来显示发送邮件的进度?我已经编码了强大的错误检查,以检查邮件是否实际发送等,但我错过了一种给用户通过进度条等实际将邮件发送到服务器的可视线索的方式。
Is there a way, using other technologies, possibly, but still using PHP as the main language, to show progress of the mails being sent? I have coded robust error checking to check if the mail was actually sent, etc. but i am missing a way of giving users the visual clue of actually delivering the mail to the server via a progress bar, etc.
这可能使用PHP和Ajax吗?你如何确定邮件在过境中的进度?
Is this possible using PHP and something like Ajax? How would you determine the progress of the mail in transit?
推荐答案
我认为这里最好的选择是估计时间。您可以测试一些10MB邮件需要发送多少时间,以了解SMTP服务器的接收速度。有了这些信息,您可以根据其大小估算任何电子邮件的传输时间,并根据该信息给您的客户端一些视觉上的分心。
I think the best option here is by estimating the time. You can test how much time some 10MB mails takes to be sent, to know the receiving speed of you SMTP server. With that information you can estimate transfer time of any email based on its size, and give your client some visual distraction based on that.
这篇关于在发送用户反馈的同时,可以使用PHP发送邮件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!