Print Page | Close Window

Switching asSmartMail to 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=3492
Printed Date: 29 March 2026 at 5:00pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Switching asSmartMail to CDONTS
Posted By: deguru
Subject: Switching asSmartMail to CDONTS
Date Posted: 12 June 2003 at 11:38pm
Dear developers..

I want to give more service for my visitor who can send e-card from my site... I selected on e-card system but I've found some problem, problem not in the script but the problem is that my hosting company doesn't support mailserver object.. so I need help to change mailserver mailing object with CDONTS. and One thing more :) the mailserver name save in a database file..

Starting CODE for sending e-card send.asp
---------------

<!--#include file="config.asp"-->
<%
im = request.form("image")
ida = request.form("id")
title = request.form("title")
toname = request.form("toname")
tomail = request.form("tomail")
fromname = request.form("fromname")
frommail = request.form("frommail")
message = request.form("message")
bgcol = request.form("bgcol")
txtcol = request.form("txtcol")
sound = request.form("sound")
set Conna= Server.CreateObject("ADODB.Connection")
set rsa = server.CreateObject("ADODB.RecordSet")
Conna.Open Conn_String
sqla ="select * from sent"
SQLB = "select * from config"
set rsb = conna.execute (sqlb)

RSa.open sqla,Conna,1,3
RSa.AddNew
randomize
rsa("pid") = int(rnd*99999)+1
RSa("card")=im
RSa("fromname")=fromname
RSa("frommail")=frommail
RSa("toname")=toname
RSa("tomail")=tomail
RSa("title")= title
RSa("bgcol")= bgcol
RSa("txtcol")= txtcol
RSa("message")= message
RSa("sentdate")= date()
RSa("sound") = sound
RSa.update
response.write "sent"
ticket = rsa("pid")
mysite = rsb("url")
myname = rsb("myname")
days = rsb("days")
Set mySmartMail = Server.CreateObject("aspSmartMail.SmartMail")
mySmartMail.Server = rsb("mailserver")
mySmartMail.SenderName = fromname
mySmartMail.SenderAddress = frommail
mySmartMail.Recipients.Add tomail
mySmartMail.Subject = "You Have a Feelings Card"
mySmartMail.Body = toname &"," & vbCrLf & fromname & " " & "Has sent you a X-pressional Feelings card "& vbCrLf &_
"You can pick up your Feelings on our site" & " "& mysite & vbCrLf & "by entering your ticket number witch is: " & ticket & vbCrLf & " or simply click on the bleow url to automaticly view your card " & vbCrLf & mysite& "/get.asp?ticket="& ticket & vbCrLf & vbCrLf & "Regards" & vbCrLf & myname & vbCrLf & "* Card must be recived within " & days & " days or it will be deleted" &_
"Thank you and,<br>have a nice day...<p>"&_
"----------------------------------------------<br>www.dotFeelings.com<br>a site by Kar<b>Crush</b>"

' Send the message

mySmartMail.SendMail

if Err.Number<>0 then

Response.write "Error: " & Err.description

else%>

<center>
<font size ="4" color="#CD5F93" face="Trebuchet MS">Your Feelings has been sent to:<br>
<%=toname%> (<%=tomail%>)<br>
<hr>
<a href = "index.asp"> Send more Feelings to other </a></font>
</center>


<%
end if
rsa.close

%>

---------------
end script

hope I'll recive quick response from you.
Thanks



-------------
GURU



Replies:
Posted By: Scotty32
Date Posted: 13 June 2003 at 2:47am

http://www.webwiz.net/asp/tutorials/email_using_cdonts_tutorial.asp - http://www.webwiz.net/asp/tutorials/email_using_cdonts_tutorial.asp

go here!

its a tutorial on CDONTS

am guessing all you need to do is change it from:

Set mySmartMail = Server.CreateObject("aspSmartMail.SmartMail")

to

Set objCDOMail = Server.CreateObject("CDONTS.NewMail")

of course you will need to change other things, but really, all you'll need to do is change the component used

you might also want to put this in: objCDOMail.BodyFormat = 0

hope this helps



Posted By: deguru
Date Posted: 14 June 2003 at 12:18am

Thank you scotty_32 Im really thankfull to you..

Thanks Again



-------------
GURU



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