We help IT Professionals succeed at work.

cannot use asp to send email

godman_polly
godman_polly asked
on
Hi,

          I would like to use asp to send email, however I always fail with creating the mail object, don't you know what's wrong? The srcipt is as follow.

<%
  Dim message
  Dim MyMail
 
  For Each x In Request.Form
  message =x & ": " & Request.Form(x) & "\n"
  Next
           
  Set MyMail = Server.CreateObject("CDONTS.NewMail")             //error line
  MyMail.From= "yylaw@se.cuhk.edu.hk"
  MyMail.To= "polly@cuhk.edu.hk"
  MyMail.Cc="godman_polly@yahoo.com"
  MyMail.FromName"Polly Law"
  MyMail.Subject="Online Registeration Form Receipt"
  MyMail.Body= message
  MyMail.Send
  set MyMail=nothing
%>


             Besides, could you teach me how to insert a record into a ms accesss 2000 db?
Comment
Watch Question

Commented:
what is exact error?
CERTIFIED EXPERT
Top Expert 2005

Commented:
Do you know for certain that you have all the necessary components for CDONTS installed? Are you running SMTP services on the server that is hosting this code? If "No" to either of these questions, your code just won't work.

If that is the case, I can propose another solution if you are interested.

Fritz the Blank

Author

Commented:
I don't know. I am using the account form www.brinkster.com. It is not allow to send email.

Commented:
godman_polly,

in there us no support email without payment member.

regards,
wee siong

Commented:
godman_polly,

>Besides, could you teach me how to insert a record into a ms accesss 2000 db?

<%
set conn=server.CreateObject("adodb.connection")
conn.Open "Provider=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE="&Server.MapPath("YourMdb.mdb")

SQLStr = "INsert into table (value1, value2) values ('value1','value2')

Conn.Execute SQLStr

%>

Regards,
Wee Siong
CERTIFIED EXPERT
Commented:
As far as I know, there's no hosts available that provide CDONTS service without payment. However, if you really do need an email feature in your application, you might want to try DomainDLX. DomainDLX provides AspEmail component support and thus allows members to implement email features.

You can download AspEmail from
http://www.aspemail.com
To learn how to code using the AspEmail component, you can download its user manual from the site itself. It is very comprehensive and complete. There's even an asp example page showing that. Install AspEmail on your own machine for testing before deploying onto DomainDLX.

Register for DomainDLX at
http://www1.domaindlx.com/



hongjun

Explore More ContentExplore courses, solutions, and other research materials related to this topic.