This topic is locked

Email - Selected Email address in form

7/10/2008 8:59:55 PM
ASPRunnerPro General questions
lefty author

Anyone have an idea on this one.

I have a form where a user enters in some fields on the add page and picks a user to send to . One of the fields an email_tofield ( auto populated from another users table lookup and auto populates email field ) . What I'm trying to do is sendmail to the email address of the field ( email_to) that was added to the record .
Here is my After record added code
' Parameters:

' dict - Scripting.Dictionary object.

' Each field on the Add form is represented as a 'Field name'-'Field value' pair
'** Custom code ****

' put your custom code here

str = "select * from messages where Userid='" & Session("UserID") & "'"

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

rsTemp.open str, dbConnection

Session("slsm_name")= rsTemp("slsm_name")

Session("to_email") = rsTemp("to_email")

Session("email_from") = rsTemp("email_from")

Session("Subject") = reTemp("Subject")
Dim dkeys

message =""
dkeys = dict.keys

For n = 0 To dict.Count-1

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

Next
' Instead of "test@test.com"
[font=Arial Black]subject="New Message" & rsTemp("Subject") 'Instead of "New Message"
sendmail email, subject, message
rsTemp.close : set rsTemp = nothing

BeforeAdd = True
' set BeforeAdd to True if you like to proceed with adding new record

' set it to False otherwise
The record gets added but the email does not go . No error message

J
Jane 7/11/2008

It's difficult to tell you what's happening without seeing actual files.
Please publish your project on Demo Account and send to support@xlinesoft.com a URL to your pages along with instructions on reproducing this error.

I'll find what's wrong with your project inspecting it at Demo account site.

lefty author 7/11/2008

It's difficult to tell you what's happening without seeing actual files.

Please publish your project on Demo Account and send to support@xlinesoft.com a URL to your pages along with instructions on reproducing this error.

I'll find what's wrong with your project inspecting it at Demo account site.



This is an before add event code . The files are and add page , edit page and a list page . All the fields listed in the event are in the add , edit and list page.

I assume this code above is correct then?

Uploaded to demo account anyway . Thanks