Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2003
    Location
    São Paulo - Brazil
    Posts
    8

    Unanswered: Help: Sending E-mails

    Hello, I am totally newbie to asp.
    I found a piece of code that shows me how to send emails:
    Heres the code of my page:

    <html>
    <head>
    <title>ASP Page - Send Emails</title>
    </head>
    <body bgcolor="white" text="black">

    <%
    Set objmail = Server.CreateObject("CDONTS.NewMail")
    objmail.from = "me@mycompany.com.br"
    objmail.to = "me@yourcompany.com.br"
    objmail.subject = "This is a test"
    objMail.BodyFormat = 0
    objMail.MailFormat = 0
    objmail.body = "test"
    objmail.send
    set objmail = nothing
    %>

    </body>
    </html>

    I saved the page as testmail.asp and it didnt work. ok, what do I have to do?
    Please help.

    Thanks a lot,
    venusgirrl

  2. #2
    Join Date
    Jun 2003
    Posts
    3
    You should probably use CDO, not CDONTS for sending e-mail in ASP. Windows 2000 and later support CDO mail.

    Here's a link to the Microsoft documentation:
    http://msdn2.microsoft.com/en-us/library/ms870503.aspx

    For the code posted in your message to work, you need the CDONTS.SYS dll installed on the server. IIS should also have SMTP running.

  3. #3
    Join Date
    Aug 2003
    Location
    São Paulo - Brazil
    Posts
    8
    hey jmfblazer,
    where can i download the cdonts.sys dll and how do i install it?

  4. #4
    Join Date
    Jun 2003
    Posts
    3
    It's been a long time since I've installed it.

    Try http://www.cdolive.com/cdo.htm.

    Another download location:

    http://www.microsoft.com/downloads/d...DisplayLang=en

  5. #5
    Join Date
    Sep 2006
    Posts
    265
    Do you need your email form that visitors fill out information or simply "create" an email?

  6. #6
    Join Date
    Jun 2003
    Posts
    3
    This can be used with a web page where visitors enter information. It can also be used when you need to generate an e-mail based on some user action on a web page.

    If you want to pop up a new e-mail message from the user's e-mail client (such as Outlook or Outlook Express), then this is not what you want to use.

  7. #7
    Join Date
    Sep 2006
    Posts
    265
    The easy bit is:

    <a target=_top href="mailto:foo@foo.com?subject=contacting Foo">Contact foo

    The subject relates to the page, if you need a more complex solution then before you go down the cdonts route check that it is being supported on the web hosting service as it looks as though it is being phased out. If you want a cdonts script let me know.

Posting Permissions

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