简体   繁体   English

如何延迟发送电子邮件? 单击按钮立即发送,但要等到下午6.00点才实际发送电子邮件

[英]How to delay the dispatch of an e-mail? Click button to send NOW but wait until 6.00pm until the email gets actually sent

I have a php script that does some processing (creates remittance advice PDFs, self-billing invoices, Sage CSV file etc...) and at the end outputs a screen with a form, in which the names and e-mail addresses of the people paid appear. 我有一个php脚本,可以进行一些处理(创建汇款通知PDF,自计费发票,Sage CSV文件等),最后输出带有表单的屏幕,其中包含表单的名称和电子邮件地址。付费人出现。 User makes a selection of names by clicking check boxes and then there is a Send button which sends out emails with remittance advices and self-billing invoices attached. 用户通过单击复选框来选择名称,然后有一个“发送”按钮,用于发送附有汇款建议和自动开票的电子邮件。 This all works nicely, BUT they now decided that when they click the Send button, they would like the e-mails to be sent NOT straight-away, but at 6.00pm. 一切都很好,但是他们现在决定单击“发送”按钮时,希望不是在6.00pm立刻发送电子邮件。

Is it possible to set the dispatch time of the message in the SMTP header? 是否可以在SMTP标头中设置邮件的发送时间? Can the MS Exchange server be configured so that e-mails from a particular sender will be held until a certain time before they get sent? 是否可以配置MS Exchange服务器,以便将来自特定发件人的电子邮件保留到发送之前的某个时间? IT Support dept. IT支持部门。 claim it used to be possible in the old days of dial-up connections when it was simply cheaper to send stuff at night... but that this functionality was removed. 声称在过去的拨号连接中它曾经是可行的,那时在晚上发送东西只是便宜些...但是此功能已被删除。 Is this true? 这是真的? I have no idea how hard is the task at hand. 我不知道手头的任务有多艰巨。 It seems very straightforward and I guess it really is a task for the IT support guys to handle. 这看起来非常简单,我想这确实是IT支持人员要完成的任务。 But maybe I am wrong? 但是也许我错了?

If this can not be set up at the Exchange server side, how could I go about achieving the requested functionality? 如果无法在Exchange服务器端进行设置,我该如何实现所需的功能? And, no, this is not an exact duplicate of this question . 而且,不,这与该问题不完全相同。 I had a look at that but it didn't seem to answer my questions. 我看了一下,但似乎没有回答我的问题。 Any help greatly appreciated! 任何帮助,不胜感激!

Edit 编辑


Apache running on MS Windows Server 2003. Database is Oracle 10g. Apache在MS Windows Server 2003上运行。数据库为Oracle 10g。 There will be no CRON set up. 不会设置CRON。 The email queue table would need to store all attachments too. 电子邮件队列表也需要存储所有附件。 I would like to avoid doing this at all cost. 我想不惜一切代价避免这样做。 No way to specify dispatch time in header? 无法在标题中指定调度时间?

You could save those emails into a database. 您可以将这些电子邮件保存到数据库中。 And then create a cronjob PHP file that executes every few minutes to check if there are emails to be sent in the "queue" database. 然后创建一个cronjob PHP文件,该文件每隔几分钟执行一次,以检查“队列”数据库中是否有电子邮件要发送。

Here's a tutorial on something like this. 这是有关此类内容的教程

Windows (non-server editions, at least) has a "Scheduled Tasks" control panel item similar to CRON. Windows(至少是非服务器版本)具有类似于CRON的“计划任务”控制面板项。 Just from looking at it briefly, you can probably write a PHP script which sends your mail "now," but run it using the CLI at whatever time you want to send the mail using Scheduled Tasks. 只是简单地看一下,您可能可以编写一个PHP脚本来“立即”发送邮件,但是无论何时您想使用“计划任务”发送邮件,都可以使用CLI运行它。

Actually you can do this. 实际上,您可以执行此操作。 If you are using an exchange 2003 server, you can set up a different SMTP connector. 如果使用的是Exchange 2003服务器,则可以设置其他SMTP连接器。 Under the delivery options there is a way to change it from send always any scheudle you pick. 在交付选项下,有一种方法可以将其更改为始终发送您选择的任何安排。

Here is a nice tutorial for setting one up. 这是一个不错的设置教程。 link text 连结文字

One thing you will need to do is when you create the new SMTP connector, set it up with a different port to listen on. 您需要做的一件事是在创建新的SMTP连接器时,使用其他端口进行设置以进行侦听。 That way you can send to that one instead of the standard connector. 这样,您可以发送给那个而不是标准连接器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM