If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Help: Sending E-mails

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-29-07, 11:25
venusgirrl venusgirrl is offline
Registered User
 
Join Date: Aug 2003
Location: São Paulo - Brazil
Posts: 8
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
Reply With Quote
  #2 (permalink)  
Old 01-29-07, 12:15
jmfblazer jmfblazer is offline
Registered User
 
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.
Reply With Quote
  #3 (permalink)  
Old 01-29-07, 12:28
venusgirrl venusgirrl is offline
Registered User
 
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?
Reply With Quote
  #4 (permalink)  
Old 01-29-07, 12:38
jmfblazer jmfblazer is offline
Registered User
 
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
Reply With Quote
  #5 (permalink)  
Old 01-31-07, 17:19
SimonMT SimonMT is offline
Registered User
 
Join Date: Sep 2006
Posts: 265
Do you need your email form that visitors fill out information or simply "create" an email?
Reply With Quote
  #6 (permalink)  
Old 02-01-07, 12:17
jmfblazer jmfblazer is offline
Registered User
 
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.
Reply With Quote
  #7 (permalink)  
Old 02-01-07, 20:11
SimonMT SimonMT is offline
Registered User
 
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On