Hi There,
How would I go about creating a contact form in Xojo?
After filling in a form and clicking submit I would like the contents of the form sent via email.
Can that be done in Xojo?
Best Regards,
Steve.
Hi There,
How would I go about creating a contact form in Xojo?
After filling in a form and clicking submit I would like the contents of the form sent via email.
Can that be done in Xojo?
Best Regards,
Steve.
Of course this can be done. But you need to give us more details. Windows or Mac? Desktop or Web? How many mails do you want to send? Do you know what an SMTP socket is? There should be an example for using the SMTP socket.
[quote=213657:@Steve Wilson]How would I go about creating a contact form in Xojo?
After filling in a form and clicking submit I would like the contents of the form sent via email.
Can that be done in Xojo?
[/quote]
Yes, it can be done. I use that on all my web sites. But you should have posted in the appropriate target (OS X, Windows, iOS, Web) so you receive appropriate assistance.
Hi There,
Thanks for the replies.
Sorry about posting in the wrong place. This is my first post.
It is mainly for web but would also like to know how to do it for the other platforms.
I come from a .net background and I am just trying out other stuff. I have a pro license and am creating some test apps.
I am trying to do with XOJO what I am able to do using .Net.
Thanks for your help.
Best Regards,
Steve.
[quote=213672:@Steve Wilson]Hi There,
Thanks for the replies.
Sorry about posting in the wrong place. This is my first post.
It is mainly for web but would also like to know how to do it for the other platforms.
I come from a .net background and I am just trying out other stuff. I have a pro license and am creating some test apps.
I am trying to do with XOJO what I am able to do using .Net.
[/quote]
Welcome to the forum. No need for apologies. It is in your interest to use the proper channel, so you will have faster and relevant replies.
Basically, a Web contact form is a TextArea and a Send button over a WebPage. Plus TextField for the subject.
Drag an SMTPSocket over the page, then use the example code at http://documentation.xojo.com/index.php/SMTPSocket to send the message.
It is easier for your initial tests to use a standard server, but if you need to use SSL, or use GMail, see this blog from Wayne Golding : http://www.realsoftwareblog.com/2012/11/using-web-edition-with-google-powered.html
Hi Michel,
Thanks for the reply.
Looks simple enough, I’ll give it a go and see how I get on.
I appreciate the help.
Best Regards,
Steve.
How do I add the SMTPSocket?
Can’t see where to select it from.
[quote=213694:@Steve Wilson]How do I add the SMTPSocket?
Can’t see where to select it from.[/quote]
If you’re working on a desktop project, you can drag a tcpsoxket to the page and then change the Super. However, I suggest using a SecureSMTPSixket. You’ll have more luck with that with today’s login requirements.
If it’s a web project, you’ll need to add it via code.
Hi Greg,
Thanks for the reply.
<< If it’s a web project, you’ll need to add it via code.
It is a web project, is there any example code available or should I try to copy some from the examples?
Best Regards,
Steve.
There’s example code at http://documentation.xojo.com/index.php/SMTPSocket but you’ll want to use SMTPSecureSocket instead.
SMTPSecureSicket Is asynchronous so make sure you create a property on the webpage so it doesn’t go out of scope.