Here's a couple of questions:
这里有几个问题:
Is mail_queue->put supposed to insert a message twice in the database? The only differences are the time_to_send value and the user_id.
mail_queue-> put应该在数据库中插入两次消息吗?唯一的区别是time_to_send值和user_id。
This is what I get for a single message for one user:
这是我为一个用户的单个消息获得的:
1. user_id = 1, time_to_send = 2009-02-10 14:02:02
2. user_id = -1, time_to_send = 2009-02-10 14:00:02
The first one is what I would expect, but what purpose does the second one serve?
第一个是我期望的,但是第二个用于什么目的?
If I send the queue, the message will arrive twice. If I delete the one with the negative user_id, only a single mail gets sent.
如果我发送队列,则消息将到达两次。如果我删除带有负user_id的那个,则只发送一封邮件。
2 个解决方案
#1
function put($from, $to, $hdrs, $body, $sec_to_send=0, $delete_after_send=true, $id_user=MAILQUEUE_SYSTEM)
Do you pass the parameter $id_user or is it the default value?
你传递参数$ id_user还是默认值?
#2
Feeling pretty stupid right now… I went through the program line by line and sure enough, there was a an uncommented example for the put function. Live and learn.
现在感觉非常愚蠢...我逐行完成了程序,果然,put函数有一个未注释的例子。活到老,学到老。
#1
function put($from, $to, $hdrs, $body, $sec_to_send=0, $delete_after_send=true, $id_user=MAILQUEUE_SYSTEM)
Do you pass the parameter $id_user or is it the default value?
你传递参数$ id_user还是默认值?
#2
Feeling pretty stupid right now… I went through the program line by line and sure enough, there was a an uncommented example for the put function. Live and learn.
现在感觉非常愚蠢...我逐行完成了程序,果然,put函数有一个未注释的例子。活到老,学到老。