OnDeliverMessage placement of call
OnDeliverMessage placement of call
When does OnDeliverMessage get called? Before a message goes into the queue, when its the one being processed in the queue, after its been delivered?
Re: OnDeliverMessage placement of call
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation
https://www.hmailserver.com/documentation
Re: OnDeliverMessage placement of call
So where in that chain of commands does the message get put in the queue?
Re: OnDeliverMessage placement of call
I thought I answered in another thread.
OnAcceptMessage is when the message is added to the queue, but MessageID is not populated then
OnAcceptMessage is when the message is added to the queue, but MessageID is not populated then
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation
https://www.hmailserver.com/documentation
Re: OnDeliverMessage placement of call
Can you execute .Save on the message to get the ID?
Re: OnDeliverMessage placement of call
When an email is added to the end of the queue, say index 40,000, so at the end.
Does OnDeliverMessage get called then WITH AN ID, or does OnDeliverMessage get called after all 39,000 get processed on that one email?
I am trying to find a location to immediately deliever an email based on a header and cant find a good location to do this to bypass the queue.
Does OnDeliverMessage get called then WITH AN ID, or does OnDeliverMessage get called after all 39,000 get processed on that one email?
I am trying to find a location to immediately deliever an email based on a header and cant find a good location to do this to bypass the queue.
Re: OnDeliverMessage placement of call
We understand what you want, and the short answer is that you can't
Either use two hmailservers (same database and file store if you like - although not supported),and send regular mail through one and the ordinary emailed reports through the other.
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation
https://www.hmailserver.com/documentation
Re: OnDeliverMessage placement of call
You say that but you were incorrect about the OnDeliveryFailed method. The code below sends an email right away. So you are telling me there is no place in the HMailServer scripting this can happen?
Code: Select all
private void menuItemSendNow_Click(object sender, EventArgs e)
{
WaitCursor waitCursor = new WaitCursor();
hMailServer.DeliveryQueue deliveryQueue = GetDeliveryQueue();
foreach (ListViewItem item in listDeliveryQueue.SelectedItems)
{
string messageID = (string)item.Tag;
deliveryQueue.ResetDeliveryTime(Convert.ToInt32(messageID));
}
deliveryQueue.StartDelivery();
Marshal.ReleaseComObject(deliveryQueue);
}
Re: OnDeliverMessage placement of call
It does not send it right away, it escalates the message to the top of the queue. There is a difference.cblaze22 wrote: ↑2019-05-07 13:36You say that but you were incorrect about the OnDeliveryFailed method. The code below sends an email right away. So you are telling me there is no place in the HMailServer scripting this can happen?
Code: Select all
private void menuItemSendNow_Click(object sender, EventArgs e) { WaitCursor waitCursor = new WaitCursor(); hMailServer.DeliveryQueue deliveryQueue = GetDeliveryQueue(); foreach (ListViewItem item in listDeliveryQueue.SelectedItems) { string messageID = (string)item.Tag; deliveryQueue.ResetDeliveryTime(Convert.ToInt32(messageID)); } deliveryQueue.StartDelivery(); Marshal.ReleaseComObject(deliveryQueue); }
And yes, if you want this to happen you need to create a stand-alone script to monitor the queue and act accordingly. There is no place in Eventhandlers.vbs you can make it happen.
Well, unless you modify hMailServer core code, it's on Github ...
SørenR.
Woke is Marxism advancing through Maoist cultural revolution.
Woke is Marxism advancing through Maoist cultural revolution.
Re: OnDeliverMessage placement of call
What do you mean by "And yes, if you want this to happen you need to create a stand-alone script to monitor the queue and act accordingly."?
Also there has to be a method hook for this. I cant believe we cant do anything to a message before it goes into the queue or right after. Should be an easy thing to do and would be super beneficial.
Also there has to be a method hook for this. I cant believe we cant do anything to a message before it goes into the queue or right after. Should be an easy thing to do and would be super beneficial.
Re: OnDeliverMessage placement of call
If it so simple why don't you make a contribution to the code base?cblaze22 wrote: ↑2019-05-07 16:13What do you mean by "And yes, if you want this to happen you need to create a stand-alone script to monitor the queue and act accordingly."?
Also there has to be a method hook for this. I cant believe we cant do anything to a message before it goes into the queue or right after. Should be an easy thing to do and would be super beneficial.
I believe most of us have figured out that you want to be able to control queue prioritization. Question is if the core code supports this modification without someone having to rewrite the whole damn stuff.
Not that many of us here who work as programmers for a living.
SørenR.
Woke is Marxism advancing through Maoist cultural revolution.
Woke is Marxism advancing through Maoist cultural revolution.
Re: OnDeliverMessage placement of call
Can you set the deliverytime of a message in the OnDeliverMessage method?