Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Switching asSmartMail to CDONTS
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Switching asSmartMail to CDONTS

 Post Reply Post Reply
Author
deguru View Drop Down
Newbie
Newbie
Avatar

Joined: 12 June 2003
Location: Pakistan
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote deguru Quote  Post ReplyReply Direct Link To This Post Topic: Switching asSmartMail to CDONTS
    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

Back to Top
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post Posted: 13 June 2003 at 2:47am

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

Back to Top
deguru View Drop Down
Newbie
Newbie
Avatar

Joined: 12 June 2003
Location: Pakistan
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote deguru Quote  Post ReplyReply Direct Link To This Post Posted: 14 June 2003 at 12:18am

Thank you scotty_32 Im really thankfull to you..

Thanks Again

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.