NetTalk Central

Author Topic: Call "Mailto" from a form  (Read 4017 times)

ianburgess

  • Full Member
  • ***
  • Posts: 119
    • View Profile
    • Email
Call "Mailto" from a form
« on: June 15, 2012, 04:31:57 AM »
I have a web form (Memory not Table) that has some code embedded into "ValidateUpdate.2 End" so that the code is run when the form is accepted. The code creates a strng of email addresses separated by ; which I need to be "MAILTO" so that the default mail client on the user's machine opens with the email addresses inserted.

The email string is held in LOC:MailtoString and this is also saved into a session variable:  p_web.SSV('MailtoString',CLIP(LOC:MailtoString))

This might seem a sill question, but what/where do I embed to perform the actual MAILTO?

Thanks

Ian
« Last Edit: June 15, 2012, 05:22:49 AM by ianburgess »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Call "Mailto" from a form
« Reply #1 on: June 15, 2012, 06:09:41 AM »
There's a SendEmail example (12? I think?) which should point you in the right direction here.

ianburgess

  • Full Member
  • ***
  • Posts: 119
    • View Profile
    • Email
Re: Call "Mailto" from a form
« Reply #2 on: June 15, 2012, 06:21:25 AM »
Example 11 is a Sendmail example that uses Nettalk to send email. What I want to do is use "SENDTO" to pop up the user's default mail client and just populate the "To" email addresses. What I am struggling with is launching the "MAILTO" command from my embed. The actual MAILTO command would be:

'MAILTO:' & p_web.GSV('MailtoString')

.... but what is the embed to effectively open a link with the above?

ianburgess

  • Full Member
  • ***
  • Posts: 119
    • View Profile
    • Email
Re: Call "Mailto" from a form
« Reply #3 on: June 15, 2012, 10:30:34 PM »
I tried putting 'MAILTO:' & p_web.GSV('MailtoString') in the "URL on Save" box in the template, however, when I do this, the code that I had embedded in the ValidateAll embed which was previously run on clicking the "Save" button now does not run!

I am confused???

Any help as to the right way to achieve my aim of running some code and then doing a "Mailto:" on clicking Save would be appreciated.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Call "Mailto" from a form
« Reply #4 on: June 17, 2012, 09:44:31 PM »
In the server code for the button put;

    p_web.script(p_web.windowopen('mailto:bruce@whatever.com'))

ianburgess

  • Full Member
  • ***
  • Posts: 119
    • View Profile
    • Email
Re: Call "Mailto" from a form
« Reply #5 on: June 19, 2012, 12:07:02 AM »
Thanks Bruce - that did the trick!

Ian