Monday, November 19, 2012

Using Web Edition with Google Powered SItes


We’d like to than Wayne Golding for offering the following blog post on his use of Real Studio Web Edition. Wayne found Real Studio when Microsoft announced the end of VB6.  He started out programming in the 80’s implementing accounting/inventory control systems, then moved on to cutting COBOL code (and fixing millennium bugs) in the 90s.  Later he switched to DRNine11 and used Real Studio primarily to develop tools that run on Windows Servers as Services. Now he uses Real Studio Web Edition in nearly 100% of his projects.

------------

Hi All,

Today I’m going to show you how I use Real Studio Web Applications with my Google Sites powered website.  In the image below you can see a typical contact page.  What’s different is that the contact form is actually a Real Studio Web application running on a server in my datacenter.  In this case it’s a Windows server and the Real Studio Web Edition app is running as a service.


So how do I do this?


Well, first I insert a gadget into my web page, then I select More Gadgets and search for iframe.



 And Select it.



I MUST give the URL content which will be HTTP://<yourdomain>/<yourwebapp>.cgi  and links to your Real Studio Web Application.

If you don’t want scroll bars, then set the width & height to match those specified in your Web Application.

I prefer to provide my own title so I untick the Display title on gadget checkbox.

And that’s it! Simple!

With the form shown, I also send the email to myself using Gmail along with logging the message in a MySQL database.

This is all done from within my WE Application, but could be done from any Real Studio application.

First in my Project.App I create a property:

theMailServer As SMTPSecureSocket

In my Project.App.Open I initialise this object

theMailServer = New SMTPSecureSocket
t
heMailServer.Address = "smtp.gmail.com

theMailServer.Port = 465

theMailServer.Username = <your gmail username>

theMailServer.Password = "<your gmail password>"

theMailServer.ConnectionType = SMTPSecureSocket.SSLv23

theMailServer.Secure = True

It’s important that this is instantiated in the App object as we’ll be using asynchronous communication.

In the Action event of the submit button I will send the message.

Dim msg As New EmailMessage

msg.AddRecipient “<my address>”

msg.subject = Subject.Text

msg.BodyPlainText = Message.Text

App.theMailServer.AppendMessage msg

App.theMailServer.SendMessage

You’ll note there is no msg.FromAddress as this is replaced by the Username supplied to when logging in. And that’s it folks – a Real Studio Web Application integrated into Google Sites & emailing via Gmail.


1 comment:

Brad Hutchings said...

Wayne, that is awesome! Once you've done a couple, it really is less work to grind out a simple WE app to handle a form than it is to code up a form handler in PHP. Really.