Print Page | Close Window

SendMail problem using CDONTS

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=1317
Printed Date: 29 March 2026 at 5:16am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: SendMail problem using CDONTS
Posted By: eagle00789
Subject: SendMail problem using CDONTS
Date Posted: 25 March 2003 at 3:41am

In the script below i am using a drop-down box to select the e-mailadress the e-mail has to be send to. the problem is that i can not send an e-mail with it. and i have to send an e-mail with this small script.

Greetings Chris

----------------------------------------------

<html>
<head>
<title>CDONTS Test</title>
</head>
<body bgcolor="#ffffff">
<center>
<table width="500">

<%
If request.form("action")="Verstuur" then
    on error resume next
    Set Mail = CreateObject("CDONTS.Newmail")
    if err.number = 0 then
        Mail.From = "Gravenrode Website"
        Mail.To = request.form("Locatie.Selected")
        Mail.Subject = "Ziekmelding"
        Mail.Body = "CDO for NT is available on your server " & request.form("Naam")
        Mail.Send
        Set Mail = Nothing
%>
<tr>
  <td align="center">
  <b>Test Completed</b>
  <p>Your email should arrive shortly
  <% else %>
  <td align="center">
  <font face="arial">
  <h3>Test Completed</h3>
  <p>Your webserver does not support CDONTS.
  <% end if %>
  </td>
</tr>

<% Else %>
<tr>
  <td align="center">
    <font face="times new roman">
    <h2 align="center"><i>CDO for NT Test</i></h2></font>
    <font face="Arial">
    <form action="cdotest.asp" method="POST">
    <p align="center">If your server supports CDO for NTS you will receive e-mail
    <br>confirmation within a few minutes of submitting the form.
    <div align="center">
      <center><pre>De naam van uw kind: <input type="text" name="Naam" size="20">  
      De locatie van uw kind:<select name="Locatie" size="1" width="25">
<option selected>Selecteer de locatie van uw kind</option>
<option value="mailto:c.simon@gravenrode.nl">Locatie'>c.simon@gravenrode.nl">Locatie Achter de Winkel</option>
<option value="mailto:c.simon@gravenrode.nl">Locatie'>c.simon@gravenrode.nl">Locatie De Wendel</option> </select>
    </pre>
      </center>
    </div>
    <p align="center"><center><input type="SUBMIT" name="action" value="Verstuur">
    <input type="RESET" value="Wissen"></center></form></font>
    </td>
<% End If %>
</table>
</body>
</html>



-------------
Using forum at http://www.gravenrode.nl/forum/forum - Gravenrode and http://www.gravenrode.nl/forum/test_forum - here and http://217.121.39.22/forum/test_forum - here



Replies:
Posted By: eagle00789
Date Posted: 25 March 2003 at 7:51am

found the solution.
the line
          Mail.From = "Gravenrode Website"
has to be
          Mail.From = "Gravenrode Website< mailto:gravenrode@gravenrode.nl - gravenrode@gravenrode.nl >"
and the line
          Mail.To = request.form("Locatie.Selected")
has to be
          Mail.To = request.form("Locatie")

please notice that this is my first asp page i ever build my self

greetings Chris



-------------
Using forum at http://www.gravenrode.nl/forum/forum - Gravenrode and http://www.gravenrode.nl/forum/test_forum - here and http://217.121.39.22/forum/test_forum - here



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net