This topic is locked
[SOLVED]

 Multiple Events on After Record Added

9/14/2011 1:04:17 PM
ASPRunnerPro General questions
BeachyLife author

Here's what I'm trying to accomplish:
User completes the webform (which is my add page). After record is added to database, I want to:

  1. send user an email with confimation of info entered on the form
  2. send myself an email notifying me that a record has been added, including the user's name & email
  3. redirect user to another page
    Right now I have the redirect working and it displays the users name & email using session values I save in the "before record added" event.
    The piece I can't figure out is the 2 emails, or if that's even possible.
    Any suggestions would be appreciated. Thanks!

Sergey Kornilov admin 9/14/2011

You can send an unlimited number of emails from single event. Just copy and paste the code snippet that sends the email and adjust parameters like email address, body, subject etc.

BeachyLife author 9/14/2011



You can send an unlimited number of emails from single event. Just copy and paste the code snippet that sends the email and adjust parameters like email address, body, subject etc.



I'm not sure where to find the code snippet to send the email.

Sergey Kornilov admin 9/14/2011

To the best of my understanding you are able to send one email and the main question is how to send the second one. If that so, copy and paste the code snippet that sends the first email and amend some variables so second email goes to another address.
Sample email code can be found in the manual:

http://xlinesoft.com/asprunnerpro/docs/runner_mail_function.htm

BeachyLife author 9/14/2011



To the best of my understanding you are able to send one email and the main question is how to send the second one. If that so, copy and paste the code snippet that sends the first email and amend some variables so second email goes to another address.
Sample email code can be found in the manual:

http://xlinesoft.com/asprunnerpro/docs/runner_mail_function.htm



Sorry, I'm still not understanding how to send ANY email, let alone 2 emails. I see the following explanation of how to set it up, but I don't know how or where to put that code. Do I add it to the "after record added" event and if so, how does it know what the "to" email address is? Basically, what I want to send out is an email to the person who just filled out the webform. I have saved their name and email address as Session variables and would like to put that in the email body as well. Help!
Send HTML email:
// ** Send HTML email ****
set params = CreateObject("Scripting.Dictionary")
params("to")="test@test.com"
params("subject")="Sample subject"
params("htmlbody")="<body><html><p>Hello
Best regards</p></body></html>"
params("charset")="UTF-8"
runner_mail(params)

BeachyLife author 9/14/2011



To the best of my understanding you are able to send one email and the main question is how to send the second one. If that so, copy and paste the code snippet that sends the first email and amend some variables so second email goes to another address.
Sample email code can be found in the manual:

http://xlinesoft.com/asprunnerpro/docs/runner_mail_function.htm



Sorry, I'm still not understanding how to send ANY email, let alone 2 emails. I see the following explanation of how to set it up, but I don't know how or where to put that code. Do I add it to the "after record added" event and if so, how does it know what the "to" email address is? Basically, what I want to send out is an email to the person who just filled out the webform. I have saved their name and email address as Session variables and would like to put that in the email body as well. Help!
Send HTML email:
// ** Send HTML email ****
set params = CreateObject("Scripting.Dictionary")
params("to")="test@test.com"
params("subject")="Sample subject"
params("htmlbody")="<body><html><p>Hello
Best regards</p></body></html>"
params("charset")="UTF-8"
runner_mail(params)

BeachyLife author 9/14/2011

Okay, so I clicked on the "+" on the 'after record added' event page and selected "send email with new data". Changed the "tmpDict("to")=" to point to my own email to see if I get it. I didn't get the email. What am I doing wrong? Please help me.

Sergey Kornilov admin 9/14/2011

As a first step make sure correct SMTP server settings are provided under Security->User Login settings.

BeachyLife author 9/15/2011



As a first step make sure correct SMTP server settings are provided under Security->User Login settings.



I've done that but still not able to send email.

Sergey Kornilov admin 9/15/2011

Post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program. Someone will take a look at this.

BeachyLife author 9/19/2011

Changed the port from 25 to 80 and email goes out just fine. Thanks for all your help and support.

Sergey Kornilov admin 9/19/2011

This is some sort of mistake, port 80 is used by web servers.