var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
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:
<title>ASP Page - Send Emails</title>
<body bgcolor="white" text="black">
Set objmail = Server.CreateObject("CDONTS.NewMail")
objmail.from = "firstname.lastname@example.org"
objmail.to = "email@example.com"
objmail.subject = "This is a test"
objMail.BodyFormat = 0
objMail.MailFormat = 0
objmail.body = "test"
set objmail = nothing
I saved the page as testmail.asp and it didnt work. ok, what do I have to do?
Thanks a lot,
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:
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.
where can i download the cdonts.sys dll and how do i install it?
Do you need your email form that visitors fill out information or simply "create" an email?
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.
The easy bit is:
<a target=_top href="mailto:firstname.lastname@example.org?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.