By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,949 Members | 1,511 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,949 IT Pros & Developers. It's quick & easy.

Inputting dbase variables to ASPEmail code

P: 2
I currently have a very wierd workaround to a simple problem. I have a page that selects a user from the dbase, works fine. Then I have an emailing code from to send confirmation emails. But i'm using Post data for this. So I select stuff from a dbase, put it into "hidden" fields, and recall the page. This then inputs the data I need into the emailing function to send the emails.

Code looks like:
Mail.Body = Request("Title")&". "& Request("Known_As")&". "& Request("Surname")& ", has selected: "& Request("Membership_Type")& ", using the Username: "& Request("Username")& ", has just registered on Global Handicaps Skukuza "

Now instead of "& Request("Known_As")&" I would like to just have the dbase fields entered directly. So replace the code "& Request("Known_As")&" with "<%=(MembersRS.Fields.Item("EMAIL_ADDRESS").Value) %>"

What is the right way to do it as all i'm getting are errors. There must be some " or & i'm missing out.

Feb 1 '07 #1
Share this Question
Share on Google+
3 Replies

Expert 100+
P: 1,208
<%=(MembersRS.Fields.Item("EMAIL_ADDRESS").Value)% >looks fine to me whats the errors and post your code
Feb 1 '07 #2

P: 2
Got the answer. The code should look like the following:
Expand|Select|Wrap|Line Numbers
  1. Mail.Body = Request("Title") &". " & MembersRS("EMAIL_ADDRESS") &". " & Request("Surname") & ", has selected: " & Request("Membership_Type") & ", using the Username: " & Request("Username") & ", has just registered on Global Handicaps Skukuza "
So instead of the POST input from Request I just put in the table MembersRS (note the EMAIL_ADRESS entry)

Thanks :)
Feb 1 '07 #3

P: 12
Hey guys, I'm also trying to use ASPEmail to send an email when the form is submitted. The script tells me that the email was successsfully sent but I'm not seeing any emails. I enabled my SMTP server so that it allows me to transfer emails. I'm also running IIS on an XP machine locally. What could be the problem?

' change to address of your own SMTP server
strHost = ""

If Request("Send") <> "" Then

Set Mail = Server.CreateObject("Persits.MailSender")
' enter valid SMTP host
Mail.Host = strHost

Mail.From = Request("From") ' From address
Mail.FromName = Request("FromName") ' optional
Mail.AddAddress Request("To")

' message subject
Mail.Subject = Request("Subject")
' message body
Mail.Body = Request("Body")

strErr = ""
bSuccess = False
On Error Resume Next ' catch errors
Mail.Send ' send message
If Err <> 0 Then ' error occurred
strErr = Err.Description
bSuccess = True
End If
End If
Feb 12 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.