This topic is locked

I cannot understand the E-Mail Function

3/4/2009 9:06:47 AM
ASPRunnerPro General questions
C
Conrunner author

Hello

I am very new to this and wondered if anyone could help. I have a database to which I am asking numerous individuals to submit data. What I want to do is set the system up so that every time a new record is added to the database I receive an e-mail informing me of this. I have no experience of automated e-mail however and therefore don't even know where to start. I have tried several times with ASPRunnerPro 6 to set this up but nothing happens. I am sure this is just because I am not entering the correct e-mail parameters or information. I therefore wondered if anyone could possibly talk me through the process. I realise that this is probably terribly basic but I really don't have a clue and would therefore be extremely grateful for any help.

Many thanks.

Con

R
Roger 3/4/2009

Try this Con (I'm still new here, but this works for me).
Use "Add Action"in the "After Record Added Event" for the relavent table. Select "Send Mail with New Data".
Bear in mind that you need to setup the Email Section for this to work. Do this on the "Security - User Logon" Page.
Also, you can customize the code for additional functionality (CC, BCC etc).
Hope this helps.
Roger.

C
Conrunner author 3/4/2009

Try this Con (I'm still new here, but this works for me).

Use "Add Action"in the "After Record Added Event" for the relavent table. Select "Send Mail with New Data".
Bear in mind that you need to setup the Email Section for this to work. Do this on the "Security - User Logon" Page.
Also, you can customize the code for additional functionality (CC, BCC etc).
Hope this helps.
Roger.


Hi Roger. Thanks for replying.

This I'm afraid is my problem. I dont know what to put in any of the fields in the User Login Settings.

I have ticked "Send E-Mail to Admin" after ticking "New User Registration Page" and then unticking this again as I dont want a New User Registration Page. I don't even know if this is right, but then I dont know what to put in any of the boxes...

User E-Mail Field, From E-Mail Address, SMTP Server, SMTP Server Port, SMTP Username or SMTP Password. The problem is that I dont know what these are and cant seem to be able to find out.

Can anybody help?

Sergey Kornilov admin 3/4/2009

Contact your ISP or web hosting support team to find correct SMTP settings.
Usually they are the same settings you use to send email in your desktop email program like Outlook.

C
Conrunner author 3/5/2009

Contact your ISP or web hosting support team to find correct SMTP settings.

Usually they are the same settings you use to send email in your desktop email program like Outlook.


Thank you very much. I shall try to do this. Your help is very much appreciated.

Con.

R
Roger 3/7/2009

I dont know what to put in any of the boxes...

User E-Mail Field, From E-Mail Address, SMTP Server, SMTP Server Port, SMTP Username or SMTP Password. The problem is that I dont know what these are and cant seem to be able to find out.

Can anybody help?


As a provider of this type of service I can suggest that you can get most of the details from your existing emails.
User Email Field: your email address, for example CON@HERE.COM

From: probably the same as above. But I generally use a BlackHole antispam address here, particularly if your email is hosted by someone like Yahoo, Gmail etc. It is typical for hackers and spammers to query the providers SMTP server and get email addresses. Technically speaking you could put anything here like: BLACHOLE@NOWHERE.COM, almost anything. Of course, you won't receive any emails with a Blackhole address... Just a few thougths.

SMTP Server: difficult, but here is the rule of thumb: SMTP.HERE.COM (SMTP is the norm). Try confirming this by dropping into a DOS box and type "ping smtp.mymail.com" (where mymail.com is your domain address - the part after the @). If you receive a timeout see my notebelow,

SMTP Server Port: 25- Industry Standard,

SMTP UserName and Password: use the same one that you are using for your email login.
NOTE:If you are using OUTLOOK, you can right click on the Email Mesage (DO NOT OPEN IT...) and select Options. A dialog box is displayed and all the above information is displayed from the MIME/SMTP header.
If you need further assistance with this, post a reply here with your email and I'll see of I can help further. Actually I'll probably get you to send me an email and I'll get it from the MIME content.
Of course, this may all be moot if you've gotten in touch with your ISP.
Anyway, hope this is of help to you or others.
Roger.

W
wisdom2009 3/8/2009

Hi Con,
I can show my example. i add an email field where i did put my email as default and everytime a user add request my email is populated when they click on submit i receivee an email, below is my example.
// After record added

Sub AfterAdd(dict,keys,inline)

' Parameters:

' dict - Scripting.Dictionary object.

' Each field on the Add form is represented as a 'Field name'-'Field value' pair
'** Send email with new data ****

' do not forget to setup email parameters like From, SMTP server etc

' on 'Security->User login settings' dialog
Dim dkeys

message ="Request " & dict("CaseID") & vbcrlf & vbcrlf
dkeys = dict.keys

For n = 0 To dict.Count-1

message = message & dkeys(n) & " : " & dict(dkeys(n)) & vbcrlf

Next
email=dict("Email")

subject="CaseID : " & dict("CaseID") & ", has been added to your Queue by : " & dict("Requestor Name")
sendmail email, subject, message

C
Conrunner author 3/10/2009

Hi Con,

I can show my example. i add an email field where i did put my email as default and everytime a user add request my email is populated when they click on submit i receivee an email, below is my example.
// After record added

Sub AfterAdd(dict,keys,inline)

' Parameters:

' dict - Scripting.Dictionary object.

' Each field on the Add form is represented as a 'Field name'-'Field value' pair
'** Send email with new data ****

' do not forget to setup email parameters like From, SMTP server etc

' on 'Security->User login settings' dialog
Dim dkeys

message ="Request " & dict("CaseID") & vbcrlf & vbcrlf
dkeys = dict.keys

For n = 0 To dict.Count-1

message = message & dkeys(n) & " : " & dict(dkeys(n)) & vbcrlf

Next
email=dict("Email")

subject="CaseID : " & dict("CaseID") & ", has been added to your Queue by : " & dict("Requestor Name")
sendmail email, subject, message


Thank you very much for this Hicham

This does work, but unfortunately the default e-mail is not the same for each entry. The entry into this table (Table 1) corresponds to data in another Table (Table 2) and the entries are linked by the ID number in both tables. This would be great if I knew how to get the value for the e-mail in the new entry to Table 1 to automatically reflect the e-mail address in Table 2 (ie; where the ID values match), but I dont know how to do this. Any further ideas?

Thank you very much once again

J
Jane 3/12/2009

Hi,
you can select values from another table using this code:

str = "select Field1,Field2 from Table2 where ID=" & keys("ID")

Set rstmp = server.CreateObject("ADODB.Recordset")

rstmp.open str,dbConnection

email = rstmp("Field1")

rstmp.close

set rstmp=nothing

C
Conrunner author 3/13/2009

Hi,

you can select values from another table using this code:


Hi Jane,

Thanks but I am not sure about what this means. Where do I put this coding and does Field 1 in the "email = rstmp("Field1")" line mean the e-mail field in my Table 1 which I want to be automatically populated?

C
Conrunner author 3/13/2009

Hi,

you can select values from another table using this code:


Hi again Jane

I sent the below post the other day. Is your above reply a response to this query?...
Hello

I am a real newbie to all of this and would really appreciate any advice. I shall try to describe my problem step by step...

  1. I have two tables, Table 1 and Table 2. I use the Add Page for Table 1 to enter usernames and passwords for specific managers and then use the print

    page for Table 1 to generate a letter to these managers informing them of what their usernames and passwords are. (I am asking them to provide me with

    feedback basically)
  2. The managers recieve their letters and use their usernames and passwords to access specific data in Table 1. On this page however is also a link to the

    ADD page for TABLE 2 and the managers use this page to submit feedback data to TABLE 2
  3. When the manager hits this link the ID Number from Table 1 (Table 1 contains their username and password so in a sense is a "Lookup" table) is

    automatically entered into thier corresponding record in Table 2 and this is how the records in Tables 1 and 2 are linked
    I am not the only person however who enters data into Table 1 - there are others as well - (We are doctors asking managers for feedback on advice we have given them). I would like each doctor to be automatically e-mailed each time a manager replies. The doctors' e-mail adresses are present in Table 1, but not in Table 2, which is the table to which managers are submitting their feedback. What I want to do basically is...
  4. Create a field in Table 2 named "Doctor's E-Mail" (There is a "Doctor's E-Mail" field in Table 1 which is automatically populated when a doctor is

    logged in, enters a new manager UN and PW and requests advice)

    2 Assign a "default value" for the Doctor's E-Mail field in Table 2 which is determined by

    -Looking at the ID Number in Table 2

    -then looking for the corresponding ID Number in Table 1

    -then looking for the corresponding E-Mail Address in the Doctor's E-Mail field in Table 1
  5. Automatically enter the corresponding Doctor's E-Mail address in Table 1 into the Doctor's E-Mail address in Table TWO so that this field can then be used

    as the "User E-Mail" Field in the project for Table 2
    Basically what I am trying to do is to get fields in a record in one table to automatically reflect the values in related fields in another table but am unsure of the VB Script (Sorry - not unsure - don't have a clue). I have used the " Session("_" & strTableName &"_OwnerID") " thingy to automatically fill in fields in Table 1 depending on which doctor is logged on, but do not know how to modify this further.
    I really would appreciate any help that anyone could give me, although on reading what I have just typed I am indeed dubious as to whether anybody will actually understand what my problem is, let alone know how to solve it!
    Many Thanks.

    Con.

J
Jane 3/13/2009

Hi,
using code I've mentioned before you can select values from another table based on the username and password or ID value in the Add page: Before process event, then save selected email address in the session variable and use it as default value on the"Edit as" settings dialog on the Visual Editor tab.
Also you can publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages and I'll try to help you.

C
Conrunner author 3/13/2009

Hi,

using code I've mentioned before you can select values from another table based on the username and password or ID value in the Add page: Before process event, then save selected email address in the session variable and use it as default value on the"Edit as" settings dialog on the Visual Editor tab.
Also you can publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages and I'll try to help you.


Hi Jane

I think that I have done this

I have uploaded the first half of my project to Demo Account at http://demo.asprunner.net/Account/Projects_list.aspx
Username admin and Password admin can be used to log in.

On the Add Page the "Practitioner who performed the Assessment" field is automatically populated because the "system" knows who has logged in. The next field however "Practitioner E-Mail" has to be selected, but I am trying to get it to be automatically populated with the correct e-mail address from the corresponding field in the same table - In the case of admin having logged on the corresponding e-mail address is admin@hotmail.com. I cannot get it to do this however. I have tried using dependent drop downs but dont seem to be getting anywhere.
Can anyone help?

J
Jane 3/16/2009

Hi,
Please open a ticket at http://support.xlinesoft.com sending a direct URL to your pages on the Demo Account server along with instructions on reproducing this error.