Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 28th, 2007, 05:48 AM
Authorized User
 
Join Date: Jan 2007
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to pushpa
Default Sending the ADO recordset value hrough email

Hello all,

Here i want to send email to emplyoee of my organization For that i have use ASP(CDONTS.Newmail) method.

    I have formatted my HTML mail. But here I also want to send the data through this mail which is retrived from the databse.

So how i can embedd this recordset field in the HTML formatted mail.
code is,
<%
dim prtnm
Dim rsprtmat2
set rsprtmat2 =server.createobject("ADODB.Recordset")
rsprtmat2str= "select * from prtmast where prtid="&vprtid
rsprtmat2.Open rsprtmat2str,Connection

if not rsprtmat2.Eof then
rsprtmat2.movefirst()
end if

prtnm=rsprtmat2("prtname")


Dim MyCDONTSMail2
    Dim HTML
    Set MyCDONTSMail2 = CreateObject("CDONTS.NewMail")
    HTML = "<!DOCTYPE HTML PUBLIC""-//IETF//DTD HTML//EN"">"
    HTML = HTML & "<html>"
    HTML = HTML & "<head>"
    HTML = HTML & "<title>Sending CDONTS Email Using HTML</title>"
    HTML = HTML & "</head>"
    HTML = HTML & "<body bgcolor=""FFFFFF"">"
    HTML = HTML & "<img name=""imageF"" width=""100%"" src=""file://\\images\topban.jpg"" />"

    HTML = HTML & "<p><strong>"
    HTML = HTML & "To,Dear Receiver</strong><br></p>"

    HTML = HTML & "<table width=""100%"" border=""1"">"


    HTML = HTML & "<tr><td width=""20%""><b>Name of Category</b><td><prtnm</tr>"
        HTML = HTML & "<tr><td width=""20%""><b>Attchements</b><td>aaaaa</tr>"

    HTML = HTML & "</table><br><br>"
    HTML = HTML & "<strong> Thank you.</strong><br>"


    HTML = HTML & "</body>"
    HTML = HTML & "</html>"
    MyCDONTSMail2.From= "[email protected]"
    MyCDONTSMail2.To="[email protected]"
    MyCDONTSMail2.Subject="test"
    MyCDONTSMail2.BodyFormat=0
    MyCDONTSMail2.MailFormat=0
    MyCDONTSMail2.Body=HTML
    MyCDONTSMail2.Send
    set MyCDONTSMail2=nothing

%>

this "prtnm" is not retriving the data from database.

Anybody give me the suggestion.




 
Old March 28th, 2007, 06:21 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

This:
"<tr><td width=""20%""><b>Name of Category</b><td><prtnm</tr>"
Should be
"<tr><td width=""20%""><b>Name of Category</b><td>" & prtnm & "</tr>"


================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
 
Old March 28th, 2007, 06:43 AM
Authorized User
 
Join Date: Jan 2007
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to pushpa
Default

ohh! that solution just i got few second after i submitt that topic.
but still thank you. for the immadiate help.

regards,
pushpa






Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing ADO Recordset ByVal robzyc Access VBA 2 April 23rd, 2007 09:07 AM
Clone DAO Recordset into ADO Recordset kamrans74 VB How-To 0 March 6th, 2007 11:57 AM
ADO recordset to table kanoorani VB Databases Basics 3 May 16th, 2006 02:59 AM
ADO Recordset Scootterp Access VBA 4 February 27th, 2006 06:44 PM
Convert ADO recordset to DAO recordset andrew_taft Access 1 May 5th, 2004 02:31 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.