CSE for V16 - Initial Feedback

General discussions related to using the C# Script Engine in APL+Win.

Moderators: Tech Support, phpbb_admin

CSE for V16 - Initial Feedback

Postby Ajay Askoolum » April 28th, 2016, 4:19 pm

I've started to use this version.

- I am extremely delighted that []cse 'Close' unloads any DLL loaded by []CSE. This used to be quite an irritation since I had to close APL+Win before I could re-compile in Visual Studio; relieved that I do not have to do this anymore.

- GetMethods is a big help in constructing a method call. However, it enumerates all the parameters; there is no hint about optional parameters. Would it be possible to enhance this method such that it shows optional parameters in square brackets?
Ajay Askoolum
 
Posts: 656
Joined: February 22nd, 2007, 2:16 am
Location: United Kingdom

Re: CSE for V16 - Initial Feedback

Postby brent hildebrand » September 13th, 2016, 3:57 pm

Is "APLNext.CSScriptEngineSetup_v1.1.30.exe" the latest installer for the C# Script Engine?
brent hildebrand
 
Posts: 481
Joined: February 12th, 2007, 5:53 pm
Location: Loma Linda, CA

Re: CSE for V16 - Initial Feedback

Postby Ajay Askoolum » September 14th, 2016, 2:53 pm

I have not installed 16.1 yet. I had installed this version:

04/04/2016 11:16 4,567,040 APLNext CSE Components Setup v2.0.34.0.msi
Ajay Askoolum
 
Posts: 656
Joined: February 22nd, 2007, 2:16 am
Location: United Kingdom

Re: CSE for V16 - Initial Feedback

Postby brent hildebrand » September 14th, 2016, 3:20 pm

Ajay Askoolum wrote:I have not installed 16.1 yet. I had installed this version:

04/04/2016 11:16 4,567,040 APLNext CSE Components Setup v2.0.34.0.msi
Silly me - - yes...

I have found it very simple to send Email via secure sockets with []CSE and .Net. I can then send SMS messages direct to my cellphone, with just a few lines of code in APL+Win. Fun! :-)
brent hildebrand
 
Posts: 481
Joined: February 12th, 2007, 5:53 pm
Location: Loma Linda, CA

Re: CSE for V16 - Initial Feedback

Postby Ajay Askoolum » September 14th, 2016, 4:32 pm

Fun, yes.

If you make the leap of faith & adopt another language, the rewards are never ending. C# and APL+Win have a lot of affinity and C# with an APL mind set is a formidable proposition.

I wrote a C# application (Windows Service) that sends automated event driven emails using Microsoft's Exchange Server; it works very well.

I haven't looked into SMS - perhaps you can share your code?
Ajay Askoolum
 
Posts: 656
Joined: February 22nd, 2007, 2:16 am
Location: United Kingdom

Re: CSE for V16 - Initial Feedback

Postby brent hildebrand » September 14th, 2016, 6:05 pm

I'm sending SMS via email gateways. This requires knowing who the service provider for a given phone number. There are online databases where this can be looked up, or paid services if one were building a commercial application. The freemail service Gmail using secure connections. My cable company service does not. Sending email via Gmail and []NI is difficult, but using .Net and []CSE it is very simple.

I've attached a workspace that will send an email message via Gmail. Note, if you have 2-factor verification setup on Gmail, you need to use an application specific password which you can create in Gmail settings.

The function in the workspace has all the function calls embedded in it, they can be removed if you wish. To use the function, you need to have your Gmail user name and password. This can be included in the function as a default if you wish.

Example of sending a message via SMS to my cellphone. Verizon uses an email address of 10digitphonenum@vtext.com:
'myusername@gmail.com' 'mypassword' SendGmail '9095551212@vtext.com' 'text message go here' 'SMS'

You can send the same text message to multiple phones by nesting the "to" field of the SendGmail function.
Attachments
SENDGMAIL.w3
Send email message using []CSE via Gmail
(13.91 KiB) Downloaded 72 times
brent hildebrand
 
Posts: 481
Joined: February 12th, 2007, 5:53 pm
Location: Loma Linda, CA

Re: CSE for V16 - Initial Feedback

Postby Ajay Askoolum » September 17th, 2016, 4:58 am

As the LHA, I am using the credentials of a googlemail account, UserName Password.

Getting this error:

Code: Select all
Script Error
The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at
SendGmail[64]     Cs script
Any clues?

Also:

I am assuming that the first of the RHA is the telephone number followed by @vtext.com. Correct? In your example, the number does not seem to have an international dialling code. Why not?

UPDATE: I changed the port to 465 (was 587). I get a different error:

Code: Select all
Script Error
Failure sending mail.
SendGmail[64]     Cs script
Ajay Askoolum
 
Posts: 656
Joined: February 22nd, 2007, 2:16 am
Location: United Kingdom

Re: CSE for V16 - Initial Feedback

Postby brent hildebrand » September 17th, 2016, 3:41 pm

Authentication - you may need to generate an application specific password for your Gmail account, particularly if you are using 2-step verification.

See:
https://support.google.com/a/answer/1032419?hl=en
or
https://support.google.com/accounts/answer/185833?hl=en

If you are not using 2-step verification, you may need to make a different change, see:
https://support.google.com/accounts/ans ... 0255?hl=en

For the right argument, I shown an example of US based Verizon Email to SMS gateway. The International code is not required, just the 10-digit US phone number. For the UK, you would to lookup what the Email to SMS gateway is and use that email address. Note that the code in SendGmail will also send regular email messages to any email address (once you get over the verification hurdle).

Note: I may not have all the needed characters escaped correctly or at all in the posted function for HTML data, but for simple text, it should work.
brent hildebrand
 
Posts: 481
Joined: February 12th, 2007, 5:53 pm
Location: Loma Linda, CA

Re: CSE for V16 - Initial Feedback

Postby Ajay Askoolum » September 18th, 2016, 2:19 am

..... US based Verizon Email to SMS gateway.....
Your function works for emails but NOT for SMS when the SMTP server does not have (or automatically connects to) an SMS gateway. I can send emails, after changing the port number to use with the SMTP server.
Code: Select all
 [49]  script,←⎕tcnl,'    using (SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587))'
Both the name of the server and the port need to be verified.
Very good demonstration of how APL benefits from adopting new technology, albeit on a piecemeal basis.
With this ability to email, for instance, I can start a long running APL process and be alerted by email when it completes or encounters an error.
Thanks, Brent.
Ajay Askoolum
 
Posts: 656
Joined: February 22nd, 2007, 2:16 am
Location: United Kingdom

Re: CSE for V16 - Initial Feedback

Postby brent hildebrand » September 18th, 2016, 1:51 pm

Sending an SMS is no different that sending an email message, at least with U.S. numbers, so I'm not understanding your issue with being able to send an email and not an SMS. Sending an email to the gateway address via Gmail will generate an SMS message on my phone.

This simple project was to be able to send to a group, SMS messages automatically from within APL+Win.
brent hildebrand
 
Posts: 481
Joined: February 12th, 2007, 5:53 pm
Location: Loma Linda, CA

Re: CSE for V16 - Initial Feedback

Postby Ajay Askoolum » September 18th, 2016, 2:30 pm

I am not sure what the issue is. Emails go through but SMS do not.
- my email is *@googlemail.com but I used smtp.gmail.com and port 465
- what is @vtext.com (in your example)?
- I've tried the mobile number with and without the international dialling code.
- What is the SMS parameter?

I get "Failure sending mail."
Ajay Askoolum
 
Posts: 656
Joined: February 22nd, 2007, 2:16 am
Location: United Kingdom

Re: CSE for V16 - Initial Feedback

Postby brent hildebrand » September 18th, 2016, 3:02 pm

Each cellphone service provider has their own phone email address. The "vtext.com" example is for Verizon in the U.S. The email address which will generate an SMS message on my phone is the 10-digit phone number @vtext.com, If my number were (it is not) 909-555-1212, the SMS email address would be 9095551212@vtext.com. If my service provider were ATT, it would be 9095551212@txt.att.net. If my service provider were spring, it would be: 9095551212@messaging.sprintpcs.com.

For a list of global SMS email gateways, see:http://www.emailtextmessages.com

A UK example, Vodaphone would be: phonenumber@vodafone.net

These messages are send exactly like an email message.
brent hildebrand
 
Posts: 481
Joined: February 12th, 2007, 5:53 pm
Location: Loma Linda, CA

Re: CSE for V16 - Initial Feedback

Postby Ajay Askoolum » September 19th, 2016, 2:02 am

Thanks for the additional clues.

"failure to send" does suggest that my specification of the mobile number <address> is incorrect. I've got the number correct but obviously not the bit following the @ symbol. My phone service provider is EE - erstwhile ORANGE; I do some research to figure out what the @ suffix needs to be.

Thanks for the pointers; I'll update this when I've made progress.
Ajay Askoolum
 
Posts: 656
Joined: February 22nd, 2007, 2:16 am
Location: United Kingdom

Re: CSE for V16 - Initial Feedback

Postby brent hildebrand » September 19th, 2016, 10:59 am

A Google search shows that EE does not apparently have an Email-to-SMS gateway. Orange, which uses the EE network and apparently now is EE used to have a SMS gateway of phonenumber@orange.net. It may no longer work as it has been absorbed into EE.
brent hildebrand
 
Posts: 481
Joined: February 12th, 2007, 5:53 pm
Location: Loma Linda, CA

Re: CSE for V16 - Initial Feedback

Postby Ajay Askoolum » September 19th, 2016, 12:56 pm

Got it to work. (Not to an EE number as EE have disabled this facility - they had this facility until recently; they were using TMobile's gateway).
The problem all along with getting the correct SMS Email Gateway address.
Ajay Askoolum
 
Posts: 656
Joined: February 22nd, 2007, 2:16 am
Location: United Kingdom


Return to APL+Win & The C# Script Engine

Who is online

Users browsing this forum: No registered users and 1 guest

cron