Could be two-fold:
1. Built-in WL6-like feature
2. Code-based AlertByEmail analogue as a WealthScript method for sending customized alerts by email
1. Built-in WL6-like feature
2. Code-based AlertByEmail analogue as a WealthScript method for sending customized alerts by email
Rename
My WL6.9 strategy code heavily relies on AlertByEmail.
Please consider support AlertByEmail equivalent API in WL7.
Please consider support AlertByEmail equivalent API in WL7.
The source code is open, you can simply add it to your own method library:
http://www2.wealth-lab.com/WL5WIKI/CommunityComponentsMain.ashx
http://www2.wealth-lab.com/WL5WIKI/CommunityComponentsMain.ashx
CODE:
WealthLab.InternetEx.SendEmail(new WealthLab.EmailAlertParams(From, smtpServer, Port, _login, Pass, secure), To, Subj, Msg);
WL7's WealthLab class doesn't seem exporting InternetEx class, thus there is no SendEmail?
It's a so called extension method so it's not the WealthLab class that exposes the IntenetEx class. This is just syntactic sugar. Please read the Wiki link above, it has a pointer which explains extension methods. You'll find the class with the method in /ExtensionMethods folder of the solution (log in to the Wiki to get attachments).
As this request has reached Top-5, let me see if I can expose it as WealthScript method for Build 12 (i.e. #2) while leaving #1 (GUI feature) for Dion to decide.
Ahh, I found it in InternetEx.cs.
Because it is named as WealthLab, I thought it is the same WealthLab class and so I didn't search the code in the souce.
Because it is named as WealthLab, I thought it is the same WealthLab class and so I didn't search the code in the souce.
Added SendEmail for Build 12:
CODE:
public void SendEmail(string fromEmail, string smtpServer, string login, string password, int smtpPort, string toEmail, string messageSubject, string messageText, bool smtpEnableSSL = true)
Is this feature supported in WL8? I've not been able to get to work using sample code from QuickRef. No error message. Just no evidence of sending mail from mail server. Are there any special "using" settings?
Most likely has to do with Gmail's takedown of "Allow less secure apps to access your account". Here's a hint for your own research:
https://stackoverflow.com/questions/73365098/how-to-turn-on-less-secure-app-access-on-google
As other providers follow you can experiment with whatever options remain and configure as required. I'm not using this.
https://stackoverflow.com/questions/73365098/how-to-turn-on-less-secure-app-access-on-google
As other providers follow you can experiment with whatever options remain and configure as required. I'm not using this.
Thanks for that info, Eugene. I wasn't aware of that.
I tried with my ISP's webmail settings but wasn't able to get it to work. Not sure how to troubleshoot. Try-Catch doesn't show anything.
Do you spot anything amiss with this line of code
I insert a real domain in place of "domain"
I tried with my ISP's webmail settings but wasn't able to get it to work. Not sure how to troubleshoot. Try-Catch doesn't show anything.
Do you spot anything amiss with this line of code
CODE:
SendEmail("mentor@domain.com", "mail.domain.com", "mentor@domain.com", "[emailPassword]", port, "mentor@domain.com", "Hello World from Wealth-Lab 8", t.Description, true);
I insert a real domain in place of "domain"
finantic.Publisher already sends them via email to potential subscribers or to yourself.
I created a new outlook.com email address to serve this purpose, and it works to send out email from WL8.
Here's some sample code:
Here's some sample code:
CODE:
//insert where you want to write your email alert in body of code string messageSubject = "messagesubjecttext"; string messageText = bars.Symbol + " messagetext"; SendEmail(fromemail, smtpserver, login, emailpw, smtpPort, toEmail, messageSubject, messageText, true); //declare private variables below //email settings string fromemail = "yournewemail@outlook.com"; string smtpserver = "smtp-mail.outlook.com"; string login = "yournewemail@outlook.com"; string emailpw = "yourpw"; int smtpPort = 587; string toEmail = "whereyouwanttosendit@gmail.com";
To Post #18: check antivirus/firewall rules.
@bcdxxxx Thank you very much for testing this for me and sharing! I was able to get it working with my Outlook account. The issue was that this WL method does not appear to support SSL (port 465) unless you found a way to get that working.
@innertrader,
Sorry, I didn't try getting it to work with SSL/port 465. I figured nothing was at all super-secret that I wanted to email myself on trading signals that I needed SSL. I was just happy enough to get it to send an email after generating a signal (after failing to get it to work with Gmail).
Sorry, I didn't try getting it to work with SSL/port 465. I figured nothing was at all super-secret that I wanted to email myself on trading signals that I needed SSL. I was just happy enough to get it to send an email after generating a signal (after failing to get it to work with Gmail).
I'm using the code in the QuickRef help section. I've tried multiple email systems, confirmed the smtp servers, and tried both ports and I'm still not getting any messages. I've heard there can be issues with certain email providers; are they any out there that have been confirmed to work?
CODE:
//execute the strategy rules here, this is executed once for each bar in the backtest history public override void Execute(BarHistory bars, int idx) { if(idx == bars.Count - 1) { Transaction t = PlaceTrade(bars, TransactionType.Buy, OrderType.Market); // for Gmail, port can be 587 (TLS) or 465 (SSL) int port = 465; SendEmail("xxx@comcast.net", "smtp.comcast.net", "yyy@comcast.net", "xxxxxxxxx", 465, "pmerges@live.com", "Hello World from Wealth-Lab 8", t.Description); } } //declare private variables below
Yes, Post #14 (of this thread where I merged your topic with) points out that your selected SMTP port supposedly won't work.
I posted this separately, but just for consistency I'll add it here.
Gmail and Outlook no longer support the SMTP protocol. You will need to find an email provider that still offers this in order to make it work. I found one (runbox.com) that was easy to set up and not expensive but there are others.
Gmail and Outlook no longer support the SMTP protocol. You will need to find an email provider that still offers this in order to make it work. I found one (runbox.com) that was easy to set up and not expensive but there are others.
Re: Post #18. Unless you're talking about something Outlook specific (never used it), I'm pretty sure SMTP keeps working for my bots in Gmail if set properly (OAuth2, app passwords, etc.)
Your Response
Post
Edit Post
Login is required