Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Jul 2004
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how do you add an email function to info on a database?

    how do you add an email function to info on a database?

    i have a course list which just displays entries of a database. I want an email function so my users can email the info to themselves. Host uses ASPMail.

    thanks, help appriciated.

  • #2
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    i'm not really sure what your asking here,,
    you just want to be able to write new incoming emails to the db?

    or u just want to use the db as a sort of internal messaging system?

  • #3
    Regular Coder
    Join Date
    Jul 2004
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts
    if you go to http://www.startbar.co.uk/coursemanager/courses.asp you will see that i have a list of courses (info is taken from an access database)

    i want people to be able to email the info (the course list) to an email address.

    sort of an 'email this list' function

    type your email here...

    sorry, my explanations are poor

    thanks

  • #4
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    well then thats just a matter of creating the email to send the list,

    make a file named email.asp

    include this text:
    <form method="POST" action="send.asp">
    <input type="text" name="EmailAddy" size="20"><input type="submit" value="Send">
    </form>
    -----------------------------------------

    now make a file named send.asp
    and put this code in it:
    you will need to adjust this code to fit your own configuration.


    Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
    Mailer.FromName = "Joe’s Widgets Corp."
    Mailer.FromAddress= "Joe@somehost.com"
    Mailer.RemoteHost = "mailhost.localisp.net"
    Mailer.AddRecipient request("EmailAddy")
    Mailer.Subject = "Great SMTP Product!"
    Mailer.BodyText = "Dear Stephen" & VbCrLf & "Your widgets order has been processed!"
    if Mailer.SendMail then
    Response.Write "Mail sent..."
    else
    Response.Write "Mail send failure. Error was " & Mailer.Response
    end if



    you will also need to include some querycode from your data base into the the "Mailer.BodyText" area.

  • #5
    Regular Coder
    Join Date
    Jul 2004
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks - ill try it out tonight and ill post what happens. check back later please.

    thanks

  • #6
    Regular Coder
    Join Date
    Jul 2004
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts
    didnt work.. im geting a 500 internal server error..

    sorry im quite new to asp!

  • #7
    Regular Coder
    Join Date
    Jul 2004
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts
    what querycode?

    sorry i dont understand


  •  

    Posting Permissions

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