Page 1 of 1

Send now, doesnt send now

Posted: 2019-05-05 02:47
by cblaze22
Shouldnt the "send now" selection on something in the queue move it up the list and send it. I did this and the messages stay in the system for quite a while.

Re: Send now, doesnt send now

Posted: 2019-05-05 03:40
by mattg
They are actually sent straight away (or send next in the queue anyway) just that GUI doesn't update automatically

Re: Send now, doesnt send now

Posted: 2019-05-05 06:49
by cblaze22
Ill take your word for it.

Is there anyway to use that function "send not" through scripting?

Re: Send now, doesnt send now

Posted: 2019-05-05 09:06
by mattg
yes, and I say that because the entire admin gui is written using the COM API

Anything that you can do in the admin gui, you can script
https://www.hmailserver.com/documentati ... iveryqueue

Re: Send now, doesnt send now

Posted: 2019-05-05 14:11
by cblaze22
Ok work with me here. The below message is called before it goes in the queue correct?

Code: Select all

OnAcceptMessage(oClient as hMailServer.Client, oMessage as hMailServer.Message)
If so can I check a header in this method and call the send now method you said I could. What would the correct syntax be ?

Re: Send now, doesnt send now

Posted: 2019-05-06 03:23
by mattg
Just done a quick test

Sent a mail to a non-existent address
OnAcceptMessage was fired when the message joined the queue

OnDeliveryStart is called for each delivery attempt

Re: Send now, doesnt send now

Posted: 2019-05-06 06:40
by cblaze22
In your opinion then is it possible to run the method below, which is the "send now" logic within that method? I assume no because we dont have a MessageId? Is there no way to call .SAve on the message so we can get the messageId? I assume the code below does send the email right away, bypassing the queue.

Code: Select all

 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: Send now, doesnt send now

Posted: 2019-05-06 10:19
by mattg
cblaze22 wrote:
2019-05-06 06:40
I assume the code below does send the email right away, bypassing the queue.
Did you test it..?

Re: Send now, doesnt send now

Posted: 2019-05-06 14:21
by cblaze22
Well I would first need to check for headers for the important flag and go from there but shouldnt someone know how this method works or if .Save will save the message getting us an ID?