Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SendMail error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    SendMail error

    I recently upgraded to version 8.0.28.0 and now SendMail is no longer working. Every time my strategy tries to send an email I get the following error message:

    "There was an error while sharing from the share service {gmail}: "the calling thread must be STA, because many UI components require this"

    I do have additional data series in my strategy; I gather that triggers multi threading with NT but at the start of the OnBarUpdate() method I have the following code:

    Code:
    if (BarsInProgress != 0)
    return;

    I note the help page on multi threading makes mention of Dispatcher but after playing around with it a bit I still couldn't get it to work - no emails and the same error message. Help would be much appreciated as it's very disappointing to have an upgrade break something that was working just the day before.


    #2
    Hello newuser,

    Thank you for your post.

    Are you able to send a test message to your email from the Control Center > Tools > Options > General > Share services page? If so, I do suspect you may need to call SendMail() from within a dispatcher. What information are you trying to send with SendMail()?

    As you mentioned, the multi-threading page gives some information about using a dispatcher:There is also a snippet that uses a dispatcher on the UserControlColleciton page:Do you recall what version you were using prior to the 8.0.28.0 update? I can't think of any changes that would have had an effect on SendMail() between a previous version and the CQG serrver certificate update for 8.0.28.0.

    Please let me know if I may be of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    40 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    20 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    27 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    44 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    37 views
    0 likes
    Last Post CarlTrading  
    Working...
    X