Send now, doesnt send now

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
cblaze22
Normal user
Normal user
Posts: 165
Joined: 2011-08-30 20:16

Send now, doesnt send now

Post by cblaze22 » 2019-05-05 02:47

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.

User avatar
mattg
Moderator
Moderator
Posts: 19894
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Send now, doesnt send now

Post by mattg » 2019-05-05 03:40

They are actually sent straight away (or send next in the queue anyway) just that GUI doesn't update automatically
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

cblaze22
Normal user
Normal user
Posts: 165
Joined: 2011-08-30 20:16

Re: Send now, doesnt send now

Post by cblaze22 » 2019-05-05 06:49

Ill take your word for it.

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

User avatar
mattg
Moderator
Moderator
Posts: 19894
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Send now, doesnt send now

Post by mattg » 2019-05-05 09:06

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
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

cblaze22
Normal user
Normal user
Posts: 165
Joined: 2011-08-30 20:16

Re: Send now, doesnt send now

Post by cblaze22 » 2019-05-05 14:11

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 ?

User avatar
mattg
Moderator
Moderator
Posts: 19894
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Send now, doesnt send now

Post by mattg » 2019-05-06 03:23

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
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

cblaze22
Normal user
Normal user
Posts: 165
Joined: 2011-08-30 20:16

Re: Send now, doesnt send now

Post by cblaze22 » 2019-05-06 06:40

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);

User avatar
mattg
Moderator
Moderator
Posts: 19894
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Send now, doesnt send now

Post by mattg » 2019-05-06 10:19

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..?
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

cblaze22
Normal user
Normal user
Posts: 165
Joined: 2011-08-30 20:16

Re: Send now, doesnt send now

Post by cblaze22 » 2019-05-06 14:21

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?

Post Reply