Professional Web Applications Themes

email and database method - Dreamweaver AppDev

Hello, I have a form with information and I want to do two action on one button. Is it possible please help me? The customer put his information in the form and put the button the give an orde and then. There must be happens two actions. (1) inserting the information into the database and (2) sending the email without asking it the customer. I have already making the form automatiscly with MX2004 but puch this code in the form doesn"t work: </table> <input type="hidden" name="MM_insert" value="form1"> <input name="recipient" type="hidden" id="recipient" value="nl"> <input name="subject" type="hidden" id="subject" value="potentiele opdrachtgever"> </form> Or ...

  1. #1

    Default email and database method

    Hello,

    I have a form with information and I want to do two action on one button. Is
    it possible please help me?


    The customer put his information in the form and put the button the give an
    orde and then. There must be happens two actions. (1) inserting the
    information into the database and (2) sending the email without asking it the
    customer.

    I have already making the form automatiscly with MX2004 but puch this code in
    the form doesn"t work:

    </table>
    <input type="hidden" name="MM_insert" value="form1">
    <input name="recipient" type="hidden" id="recipient"
    value="nl">
    <input name="subject" type="hidden" id="subject" value="potentiele
    opdrachtgever">
    </form>


    Or

    Is there a method to send an email when database is inserted by every record
    automaticly?

    I hope you can follow me I wait for your answer.

    Jan

    snuif12 Guest

  2. #2

    Default Re: email and database method

    Jan

    Yes you can preform both actions on one button click. All you need to do is
    insert the email code inside of the script that handles the database insert,
    but make sure that it appears before any page redirection is fired.

    --
    Regards

    Paul Whitham
    Macromedia Certified Professional for Dreamweaver MX2004
    Valleybiz Internet Design
    www.valleybiz.net

    Team Macromedia Volunteer for Ultradev/Dreamweaver MX
    www.macromedia.com/support/forums/team_macromedia

    "snuif12" <com> wrote in message
    news:d8qtuq$ke9$macromedia.com... 
    Is 
    an 
    the 
    code in 
    record 


    Paul Guest

  3. #3

    Default Re: email and database method

    If you are using ASP, I have a free tutorial which explains how to do this.

    http://www.cgw3.co.uk/tutorials/tutorial.asp?TutorialID=23&CategoryID=3

    Originally posted by: snuif12
    Hello,

    I have a form with information and I want to do two action on one button. Is
    it possible please help me?


    The customer put his information in the form and put the button the give an
    orde and then. There must be happens two actions. (1) inserting the
    information into the database and (2) sending the email without asking it the
    customer.

    I have already making the form automatiscly with MX2004 but puch this code in
    the form doesn"t work:

    </table>
    <input type="hidden" name="MM_insert" value="form1">
    <input name="recipient" type="hidden" id="recipient"
    value="nl">
    <input name="subject" type="hidden" id="subject" value="potentiele
    opdrachtgever">
    </form>


    Or

    Is there a method to send an email when database is inserted by every record
    automaticly?

    I hope you can follow me I wait for your answer.

    Jan



    CarlGrint Guest

  4. #4

    Default Re: email and database method

    Hello CarlGrint,

    I have used
    "http://www.cgw3.co.uk/tutorials/tutorial.asp?TutorialID=23&CategoryID=3" and
    .............................. I did it, it works!!!!!

    Thanks a lot BUT I have now an other litlle problem!!

    My localhost doens't works now.
    I have used the "CDonts" version. What can I do about it??


    Jan

    snuif12 Guest

  5. #5

    Default Re: email and database method

    I would recommend using the CDOSYS version, as CDONTS does not come with XP,
    which at a guess you are running.

    Originally posted by: snuif12
    Hello CarlGrint,

    I have used
    "http://www.cgw3.co.uk/tutorials/tutorial.asp?TutorialID=23&CategoryID=3" and
    .............................. I did it, it works!!!!!

    Thanks a lot BUT I have now an other litlle problem!!

    My localhost doens't works now.
    I have used the "CDonts" version. What can I do about it??


    Jan



    CarlGrint Guest

  6. #6

    Default Re: email and database method

    Hello,

    Thanks and Yes. I am using XP.

    My problem is now that I don't understand this format what I have to put down
    after those http's?


    objMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sen
    dusing") = 2

    objMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smt
    pserver") = "localhost"

    Can you help me because that was the reason that I use the other option.

    Jan

    snuif12 Guest

  7. #7

    Default Re: email and database method

    You can leave those two lines as they are, they work fine as is, actually I
    never add in the details for the SMTP server, so that is works both locally and
    on the live site..using localhost just makes it use whatever is available.

    Originally posted by: snuif12
    Hello,

    Thanks and Yes. I am using XP.

    My problem is now that I don't understand this format what I have to put down
    after those http's?


    objMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smt
    pserver") = "localhost"

    Can you help me because that was the reason that I use the other option.

    Jan



    CarlGrint Guest

  8. #8

    Default Re: email and database method

    Hello,

    Thanks for your fast reaction but I have to ... you

    Local I get this failer:

    Runtimefout Microsoft VBScript (0x800A01A8)
    Object vereist: 'objMail'
    /gsm4all/debkpn/bestellen8.asp, line 121

    In englisch does this mean "Objest requirement"and they refer to the first
    line which I already said.

    And also on my site I get the mistake but it gives no lines.

    So maybe you have a solution if not .... I also like to hear it.

    Jan





    snuif12 Guest

  9. #9

    Default Re: email and database method

    I am not sure that line is erroring...is it on your local machine or the live
    site..?

    If it works on the live site and not your local machine, then it could be that
    you have a problem with your IIS, check our Jules article on setting up XP for
    mail

    http://www.charon.co.uk/content.aspx?CategoryID=27&ArticleID=26


    Originally posted by: snuif12
    Hello,

    Thanks for your fast reaction but I have to ... you

    Local I get this failer:

    Runtimefout Microsoft VBScript (0x800A01A8)
    Object vereist: 'objMail'
    /gsm4all/debkpn/bestellen8.asp, line 121

    In englisch does this mean "Objest requirement"and they refer to the first
    line which I already said.

    And also on my site I get the mistake but it gives no lines.

    So maybe you have a solution if not .... I also like to hear it.

    Jan







    CarlGrint Guest

  10. #10

    Default Re: email and database method

    Hello,

    Thanks for your patient.

    Local I haven't the XP mail settings. I install it and I get the same mistake.

    Soort fout:
    Runtimefout Microsoft VBScript (0x800A01A8)
    Object vereist: 'objMail'
    /gsm4all/debkpn/bestellen8.asp, line 121

    Line 121 is:
    objMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sen
    dusing") = 2

    Also live on the server I got a mistake.

    Her I give you my code you never know:

    If (Not MM_abortEdit) Then
    ' execute the insert
    Set MM_editCmd = Server.CreateObject("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_editConnection
    MM_editCmd.CommandText = MM_editQuery
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close


    'Start of script

    objMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sen
    dusing") = 2

    objMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smt
    pserver") = "localhost"


    objMail.From = "nl"
    objMail.To = "nl"
    objMail.Subject = "Contract voor debitel KPN"
    'Set the e-mail body format (HTMLBody=HTML TextBody=Plain)


    'body of email
    objMail.HTMLBody = "<font size =3 face = Verdana>" & "<strong>" &
    "Aanmelding: " & Request.Form("voorletters") & " " &
    Request.Form("achternaam") & "<br>" & "</strong>" & "</font>"
    objMail.HTMLBody = objMail.HTMLBody & "<font size =2 face = Verdana>" &
    "Address: " & Request.Form("Addressfield") & "<br>" & "<br>" & "DOB: " &
    Request.Form("DOB") & "<br>" & "<br>"
    objMail.HTMLBody = objMail.HTMLBody & "<font size =2 face = Verdana>" &
    "Geslacht: " & Request.Form("geslacht") & "<br>" & "<br>" & "Particulier of
    zakelijk: " & Request.Form("partzak") & "<br>" & "Bedrijfsnaam: " &
    Request.Form("bedrijfsnaam") & "<br>" & "E-mailadres: " & Request.Form("email")
    & "<br>" & "Telefoonnummer: " & Request.Form("telefoonnummer") & "<br>" &
    "<br>" & "</font>"
    objMail.HTMLBody = objMail.HTMLBody & "<font size =2 face = Verdana>" & "Merk:
    " & Request.Form("Merk") & "<br>" & "Type mobiel: " & Request.Form("TypeMob")
    & "<br>" & "Kleur: " & Request.Form("kleur") & "<br>" & "<br>" & "</font>"
    objMail.HTMLBody = objMail.HTMLBody & "<font size =2 face = Verdana>" &
    "Abonnement: " & Request.Form("belabonnement") & "<br>" & "Soort abonnement: "
    & Request.Form("soort") & "<br>" & "Duur abonnement: " & Request.Form("duur")
    & "<br>" & "Nummerbehoud: " & Request.Form("nummerbehoud") & "<br>"& "<br>" &
    "</font>"
    objMail.HTMLBody = objMail.HTMLBody & "<font size =2 face = Verdana>" &
    "Status: " & Request.Form("contracttoezenden") & "<br>"& "<br>" & "</font>"
    objMail.HTMLBody = objMail.HTMLBody & "Sent at " & Now() & "</font>"

    objMail.Send()

    Set objMail = Nothing
    'end of body of email


    If (MM_editRedirectUrl <> "") Then
    Response.Redirect(MM_editRedirectUrl)
    End If
    End If

    End If
    %>

    Maybe you get still an other solution of my problems.
    Is there a methode to test some things???

    Jan

    snuif12 Guest

  11. #11

    Default Re: email and database method

    Now you have posted the code I can see why you have the problem, you missed the
    first line of the code which is resulting in your error, it should be

    Set objMail = Server.CreateObject("CDO.Message")


    objMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sen
    dusing") = 2

    objMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smt
    pserver") = "localhost"

    Add in the Set objMail and it should work ok.


    CarlGrint Guest

  12. #12

    Default Re: email and database method

    Hello,

    Thanks for your patient but again another mistake:

    Soort fout:
    CDO.Message.1 (0x80040220)
    De configuratiewaarde "SendUsing" is ongeldig.
    /gsm4all/debkpn/bestellen8.asp, line 140

    Line14: objMail.Send() ...... I don't know what it is?

    Can you help me again?

    Jan

    snuif12 Guest

  13. #13

    Default Re: email and database method

    That usually means that CDOSYS is not installed, are you getting this both
    locally and live site..?

    You could download test_mailer_components.asp from my site
    (www.cgw3.co.uk/uploads/testers.zip) and check which Mail components you have,
    both locally and on the live start.
    You simply browse to the file and it will show which mail components you have
    installed.


    Originally posted by: snuif12
    Hello,

    Thanks for your patient but again another mistake:

    Soort fout:
    CDO.Message.1 (0x80040220)
    De configuratiewaarde "SendUsing" is ongeldig.
    /gsm4all/debkpn/bestellen8.asp, line 140

    Line14: objMail.Send() ...... I don't know what it is?

    Can you help me again?

    Jan



    CarlGrint Guest

  14. #14

    Default Re: email and database method

    Hello,

    Ik can tell you that it works on the server but not on my localhost.

    Than I get the mistake on line 140 on which I told you.
    Jan
    snuif12 Guest

  15. #15

    Default Re: email and database method

    Hello,

    Its a wonderfull test but I understand anything about it.

    I test Advanced Mailer Component Test and from the 8 possibilities only CDOSYS
    was installed.

    Line 140 gives the mistake

    Soort fout:
    CDO.Message.1 (0x80040220)
    De configuratiewaarde "SendUsing" is ongeldig.
    /gsm4all/debkpn/bestellen8.asp, line 140

    But on the host server it works but not locally.

    Thanks. I hope you are not on the weekend yet.

    Jan.



    snuif12 Guest

  16. #16

    Default Re: email and database method

    That means your local machine is not set up for CDOSYS then, did you follow the tutorial from charon.co.uk on ensuring your XP Pro IIS has CDOSYS working 100%..?
    CarlGrint Guest

  17. #17

    Default Re: email and database method

    Hello,

    1. On de web server its also doesn't work now in opposite for a few hours
    2. local I have teh problem on Line 140
    3. I have controled the CDOSYS and it was correct. Your test also said this I
    thougt but I have controle it again.
    4. When I put the mail out of my page everything is alright.

    When You haven't an other idea then I start tomorrow again with a new
    progressive attitude. Fresh and step by step.

    Jan


    snuif12 Guest

  18. #18

    Default Re: email and database method

    Hello,

    I didn't succeed but have done al lot again.

    1. My webserver extern is okay
    2. The CDOSYS is installed as you told by the instructions (I think!!!) by
    answering the following:

    " I am not sure that line is erroring...is it on your local machine or the
    live site..?

    If it works on the live site and not your local machine, then it could be that
    you have a problem with your IIS, check our Jules article on setting up XP for
    mail

    http://www.charon.co.uk/content.aspx?CategoryID=27&ArticleID=26 "


    3. On my localhost I run
    "http://localhost/verzameling/test_mailer_components.asp"

    This are the results:

    CDONTS Not Installed
    ASPMail Not Installed
    ASPQMail Not Installed
    JMail Not Installed
    SA-SmtpMail Not Installed
    ASPEmail Not Installed
    IPWorks Not Installed
    CDOSYS Installed

    Make sure you use a valid To Email Address or you will never receive any
    emails from this portion of the test. All fields are required.

    To Email Address: (ex: com)
    To Name: (ex: John Doe)
    From Email Address: (ex: com)
    From Name: (ex: John Doe)
    Mailer Path:(ex: mail.yourdomain.com)
    Mailer Port: (25 by default, for JMail & ASPEmail)



    Running Tests now. Any errors encountered will be printed out to the browser.

    I DID NOT GET A EMAIL !!!

    4. This is my code now:

    If (Not MM_abortEdit) Then
    ' execute the insert
    Set MM_editCmd = Server.CreateObject("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_editConnection
    MM_editCmd.CommandText = MM_editQuery
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close

    'Start mail inserted doent
    Set objMail = Server.CreateObject("CDO.Message")


    objMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sen
    dusing") = 2

    objMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smt
    pserver") = "localhost"


    objMail.From = Request.Form("email") 'sending mail adress
    objMail.To = "nl" 'receiving mail adress
    objMail.Subject = "Contract debitel KPN" 'subject of the mailadress
    'Set the e-mail body format (HTMLBody=HTML TextBody=Plain)


    'body of email
    objMail.HTMLBody = "<font size =3 face = Verdana>" & "<strong>" &
    "Aanmelding: " & Request.Form("voorletters") & " " &
    Request.Form("achternaam") & "<br>" & "</strong>" & "</font>" & "<br>" & "<br>"
    objMail.HTMLBody = objMail.HTMLBody & "<font size =2 face = Verdana>" &
    "Geslacht: " & Request.Form("geslacht") & "<br>" & "<br>" & "Particulier of
    zakelijk: " & Request.Form("partzak") & "<br>" & "Bedrijfsnaam: " &
    Request.Form("bedrijfsnaam") & "<br>" & "E-mailadres: " & Request.Form("email")
    & "<br>" & "Telefoonnummer: " & Request.Form("telefoonnummer") & "<br>" &
    "<br>" & "</font>"
    objMail.HTMLBody = objMail.HTMLBody & "<font size =2 face = Verdana>" & "Merk:
    " & Request.Form("merk") & "<br>" & "Type mobiel: " & Request.Form("type") &
    "<br>" & "kleur: " & Request.Form("kleur") & "<br>" & "<br>" & "</font>"
    objMail.HTMLBody = objMail.HTMLBody & "<font size =2 face = Verdana>" &
    "Abonnement: " & Request.Form("belabonnement") & "<br>" & "Soort abonnement: "
    & Request.Form("soort") & "<br>" & "Duur abonnement: " & Request.Form("duur")
    & "<br>" & "Nummerbehoud: " & Request.Form("nummerbehoud") & "<br>"& "<br>" &
    "</font>"
    objMail.HTMLBody = objMail.HTMLBody & "<font size =2 face = Verdana>" &
    "Status: " & Request.Form("contracttoezenden") & "<br>"& "<br>" & "</font>"
    objMail.HTMLBody = objMail.HTMLBody & "Sent at " & Now() & "</font>"

    objMail.Send()

    Set objMail = Nothing
    'end of body of email and the inserted doent




    If (MM_editRedirectUrl <> "") Then
    Response.Redirect(MM_editRedirectUrl)
    End If
    End If

    End If
    %>


    I HOPE YOU CAN HELP ME TOMORROW BECAUSE I DO NOT KNOW IT ANYMORE

    THANKS A LOT

    JAN





    snuif12 Guest

  19. #19

    Default Re: email and database method

    Hello,

    I see my story is not clear.

    My extern server with email works okay.
    My localserver didn't work.
    thats why I told you everything.

    I hope you can tell me what I am did wrong or what I have to do again!

    thanxx.

    Jan

    snuif12 Guest

  20. #20

    Default Re: email and database method

    I would suggest you check if CDOSYS is running on your XP Pro machine
    correctly, using the links I posted earlier, both to charon.co.uk and the Mail
    checker.

    As it runs on the live site it is almost defiently going to be your local
    setup.

    Originally posted by: snuif12
    Hello,

    I see my story is not clear.

    My extern server with email works okay.
    My localserver didn't work.
    thats why I told you everything.

    I hope you can tell me what I am did wrong or what I have to do again!

    thanxx.

    Jan



    CarlGrint Guest

Page 1 of 2 12 LastLast

Similar Threads

  1. Best Method to insert a Date into a MySQL database?
    By DigiWolf in forum Adobe Dreamweaver & Contribute
    Replies: 7
    Last Post: December 7th, 03:51 AM
  2. spambot email protection method?
    By Belumptuous in forum Macromedia Contribute General Discussion
    Replies: 1
    Last Post: July 7th, 01:03 PM
  3. Email to Database
    By ScooterJunk in forum Coldfusion - Advanced Techniques
    Replies: 1
    Last Post: May 13th, 08:49 PM
  4. [PHP] Email to database
    By Jay Blanchard in forum PHP Development
    Replies: 6
    Last Post: September 5th, 02:03 PM
  5. Replies: 13
    Last Post: July 9th, 08:42 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139