Sending email with ASP

Posted on 2011-10-06
Last Modified: 2012-05-12
Dear Experts,

Could you please check my code?
would it be correct to write it like this? My aim is to send emails to the mytable email list.

dim email

set con = server.CreateObject("adodb.connection")"DRIVER={Microsoft Access Driver (*.mdb)};DBQ="&Server.MapPath("the-path-of-the-file.mdb"))
set rs0 = server.CreateObject("adodb.recordset")
                              sqlcumle= "select * from mytable"
                     sqlcumle, con, 1, 3
                              do while not rs.eof
                              email = rs0("email")
msg_txt = "<table><tr><td><a href=><img src= border=0 title=title alt=alt atribute onemlidir. /></a></td></tr></table>"
      Set Mail = Server.CreateObject("CDO.Message")
      Mail.From = ""
      Mail.To = email
      Mail.Bcc = ""
      Mail.Cc = ""
      Mail.Subject = "my subject"
      Mail.HTMLBody = msg_txt

      'On Error Resume Next
      Mail.Configuration.Fields.Item ("") = 2
      Mail.Configuration.Fields.Item("") = ""
      Mail.Configuration.Fields.Item("") = 10  
      Mail.Configuration.Fields.Item("") = 25
Question by:Braveheartli
    LVL 7

    Expert Comment

    LVL 8

    Accepted Solution


    As far as I can see this code should work, the best thing to do is get the code to select one record from the database and add it to the subject then send the email to yourself, this way you'll be able to see if the data from the Access DB is ok and that the email is formatted correctly.


    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
    Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now