How enable email notification on cloud instance?

Created at 11 Aug 2024, 11:13
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
JI

jiri.work

Joined 11.08.2024

How enable email notification on cloud instance?
11 Aug 2024, 11:13


In my algo trading bot, I have an information email set to be sent at the end of the call to the onBarClose() method. When running locally, everything works as it should, but if I run the instance in the cloud, the email is not sent.

**Code example**
```C#
protected override void OnBarClosed()
       {
           // ...

           SendEmail();
        }
        
       private void SendEmail()
       {
           string from = "your-email@mail.com";
           string to = Email;
           string subject = $"Strategy {this.GetType().Name}: {this.TimeFrame.ShortName} {Symbol.Name} - successful call onBar";
           string text = "";
           Notifications.SendEmail(from,to,subject,text);
       }
```

**Log localinstance**
```log
11/08/2024 10:11:15.340 | Info | CBot instance [TurtleTrendFollow_cBot, BTCUSD, D1] started.
11/08/2024 10:11:16.403 | Info | Email "Strategy TurtleTrendFollow_cBot: D1 BTCUSD- successful call onBar" was sent to "your-email@mail.com"
```

**Log cloud instance**
```log
11/08/2024 10:11:44.044 Info | CBot instance [c56442be-4b62-4f5b-9063-56ae9da69233, BTCUSD, D1] started.
11/08/2024 10:11:45.748 Info | Email "Strategy TurtleTrendFollow_cBot: D1 BTCUSD- successful call onBar" was not sent because email notifications are disabled
```


@jiri.work
Replies

PanagiotisCharalampous
12 Aug 2024, 05:12

Hi there,

As per the message, email notifications are disabled for cloud execution.

Best regards,

Panagiotis

 


@PanagiotisCharalampous