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.