Email notification issues

Created at 20 Jan 2016, 13:49
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!
J.

j.kozlowski.net

Joined 15.11.2015

Email notification issues
20 Jan 2016, 13:49


Hi all,

 

I included email notification function in my bot following instructions found here http://help.spotware.com/calgo/cbots/email-notifications . Unfortunatelly, whenever the algo tries to send a message the following error occurs:

 

Failed to send email "Email Title". Timeout.

 

Any tip on what might cause this? I need to point out that I have enabled IMAP POP at dedicated Gmail account. I also allowed access for "less safe" applications.


@j.kozlowski.net
Replies

Jiri
20 Jan 2016, 15:56

Could you provide your method where you use SendEmail?

Make sure you use correct settings before trying to send an email notification. You can do that in Preferences -> Email Settings.

 

Example how to use it correctly:

string fromAddress = "belochjiri@hotmail.com"; //Sender's Address
string toAdress = "belochjiri@hotmail.com"; // Recipient's Address
string subject = "Testing email"; //Email Subject
string text = "This email was sent from cAlgo."; //Email Body

protected override void OnStart()
{
    SendEmail(fromAdress, toAddress, subject, text);
}

 


@Jiri

j.kozlowski.net
20 Jan 2016, 16:17

Please find the following code snippet.

 

private void alertOversold(MarketSeries mSeries, int counter)
{

       if (counter == 1)

       {

              var text = string.Format("Oscillator has crossed below in oversold zone at {0} timeframe", mSeries.ToString());

              Notifications.SendEmail("myemailaddress@gmail.com", "myemailaddress@gmail.com", "Title", text);

        }

}


@j.kozlowski.net

mindbreaker
20 Jan 2016, 17:58

RE:

Hi,

try write email function:

http://www.codeproject.com/Tips/520998/Send-Email-from-Yahoo-GMail-Hotmail-Csharp

http://stackoverflow.com/questions/29465096/how-to-send-an-e-mail-with-c-sharp-through-gmail

http://stackoverflow.com/questions/32260/sending-email-in-net-through-gmail

Bye


@mindbreaker

... Deleted by UFO ...

j.kozlowski.net
21 Jan 2016, 20:26

Thanks for help everyone!

 

It turns out gmail didn't save the "Allow less secure apps" setting the first time round. Everythig works as it should now.


@j.kozlowski.net

pozhy
11 Mar 2019, 03:44

is it still possible to get an email notification from Gmail? I have a problem

 

            Notifications.SendEmail("....@gmail.com", "....@gmail.com", "Email Subject", "Email body");

 


@pozhy

pozhy
11 Mar 2019, 23:36

I can not get an email. what is the reason? it is for Gmail configuration?


@pozhy

PanagiotisCharalampous
12 Mar 2019, 13:02

Hi pozhy,

In principle it is unless it is blocked. Paul Hayes has written a nice article about this.

Best Regards,

Panagiotis


@PanagiotisCharalampous

pozhy
12 Mar 2019, 15:44

RE:

Panagiotis Charalampous said:

Hi pozhy,

In principle it is unless it is blocked. Paul Hayes has written a nice article about this.

Best Regards,

Panagiotis

you saved my time. thank you


@pozhy