<%
set rs=server.createobject("adodb.recordset")
sql="select * from cliente where tele='"&tele&"'"
rs.open sql,conn,1,1
if not rs.eof then
email=rs("email")
rs.close
conn.close
end if
 %>
<%
'Step 1: create an object of CDO.Message
dim objMail 
Set objMail = Server.CreateObject("CDO.Message")
 
'Step 2: set the smtp server, user name and password for authentication
dim smtpServer, yourEmail, yourPassword
smtpServer = "smtp.gmail.com"
yourEmail = "nasurestaurante@gmail.com"     'replace with a valid gmail account
yourPassword = "pgdinblkmzfgtciv"           'replace with a valid password for the gmail account set in yourEmail

'Step 4: set the email address to which email will be sent
sendEmailTo = email

'Step 5: set the configuration properties of objMail object 
objMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = smtpServer
objMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
objMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465 
objMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = true
objMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = yourEmail
objMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = yourPassword
objMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60

'Step 6: update the configuration after setting all the required items
objMail.Configuration.Fields.Update
 

'Step 7: prepare your email like set subject, body, from, to etc.
objMail.From = yourEmail
objMail.To = sendEmailTo
 
objMail.Subject="您的订单，店家已经确认！"
objMail.htmlBody = "您的订单店家已经确认，稍作休息，您就能收到您的订单了，感谢您的预定！"

'Step 8: send the email
objMail.Send 

'Step 9: release the object
Set objMail = Nothing 

%>

