if remail="" or InStr(remail,".")=0 or InStr(remail,"@")=0 then
msgstr="<br><br><br><table border='0' width='350' cellspacing='0' cellpadding='0'><tr><td width='100%' bgcolor='#6666FF'><font color='#FFFF00' >发送失败</font></td></tr><tr><td width='100%' bgcolor='#6666FF'><table border='0' width='100%' cellspacing='1' cellpadding='0'><tr><td width='100%' bgcolor='#FFFFFF'><table border='0' width='100%' cellspacing='0' cellpadding='0'><tr><td width='100%'><p align='center'><font color='red' size='3'><br>邮件发送失败</font></td></tr><tr><td width='100%'><hr size='1' width='75%'></td></tr><tr><td width='100%'><p align='center'>没有填写收件人地址,或收件人地址不正确!</td></tr><tr><td width='100%'><hr size='1' width='75%'></td></tr><tr><td width='100%' align='center'><a href='javascript:history.go(-1);'>返回</a></td></tr><tr><td width='100%'></td></tr></table></td></tr></table></td></tr></table>"
else
if saveyn<>"" then
conn.execute("insert into greet(content,user_id) values('"&replace(content,"'","´")&"',"&session("oid")&")")
end if
succeed=false
Set jmail1 = Server.CreateObject("JMail.Message")
'jmail1.AddRecipient "lishenlong0001@yahoo.com.cn", "Mr.Example"
if InStr(remail,",")=0 then
jmail1.AddRecipient remail
else
remaila=split(remail,",")
if right(remail,1)="," then
tonum=UBound(remaila)-1
else
tonum=UBound(remaila)
end if
for i=0 to tonum
jmail1.AddRecipient remaila(i)
next
end if
jmail1.From = frommail
jmail1.FromName = formname
jmail1.Subject = "贺卡《"&mname&"》"
'jmail1.Body = "A nice picture if you can read HTML-mail."
' The return value of AddAttachment is used as a
' reference to the image in the HTMLBody.
' As only HTML formatted emails can contain inline images
' we use HTMLBody and appendHTML
fname=replace(http,"seecard.asp","images/"&fname)
content=replace(content,vbCrLf,"<br>")
content=replace(content," "," ")
if GetExtendName(request("fname"))="gif" or GetExtendName(request("fname"))="GIF" or GetExtendName(request("fname"))="Gif" or GetExtendName(request("fname"))="jpg" or GetExtendName(request("fname"))="JPG" or GetExtendName(request("fname"))="Jpg" then
jmail1.HTMLBody = "<img width=459 height=306 src="&fname&"></img><br>"&content
else
jmail1.HTMLBody = "<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 width=459 height=306><param name=movie value="&fname&"><param name=quality value=high><embed src="&fname&" quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=459 height=306></embed></object><br>"&content
end if
'jmail1.appendHTML
'jmail1.appendHTML
' But as not all mailreaders are capable of showing HTML emails
' we will also add a standard text body
'jmail1.Body = "Too bad you can't read HTML-mail."
'jmail1.appendText " There would have been a nice picture for you"
jmail1.Charset = "gb2312"
jmail1.ContentTransferEncoding = "base64"
jmail1.Encoding = "base64"
jmail1.ISOEncodeHeaders = false
succeed=jmail1.Send("")
jmail1.close
set jmail1=nothing
if succeed=true then
msgstr="<br><br><br><table border='0' width='350' cellspacing='0' cellpadding='0'><tr><td width='100%' bgcolor='#6666FF'><font color='#FFFF00' >恭喜您, 贺卡发送成功!</font></td></tr><tr><td width='100%' bgcolor='#6666FF'><table border='0' width='100%' cellspacing='1' cellpadding='0'><tr><td width='100%' bgcolor='#FFFFFF'><table border='0' width='100%' cellspacing='0' cellpadding='0'><tr><td width='100%'><p align='center'><font color='#329900' size='3'><br>贺卡发送成功!</font></td></tr><tr><td width='100%'><hr size='1' width='75%'></td></tr><tr><td width='100%'><p align='center'>恭喜您, 贺卡发送成功!</td></tr><tr><td width='100%'><hr size='1' width='75%'></td></tr><tr><td width='100%' align='center'><a href='javascript:history.go(-2);'>返回</a></td></tr><tr><td width='100%'></td></tr></table></td></tr></table></td></tr></table>"
else
msgstr="<br><br><br><table border='0' width='350' cellspacing='0' cellpadding='0'><tr><td width='100%' bgcolor='#6666FF'><font color='#FFFF00' >贺卡发送失败</font></td></tr><tr><td width='100%' bgcolor='#6666FF'><table border='0' width='100%' cellspacing='1' cellpadding='0'><tr><td width='100%' bgcolor='#FFFFFF'><table border='0' width='100%' cellspacing='0' cellpadding='0'><tr><td width='100%'><p align='center'><font color='#329900' size='3'><br>贺卡发送失败</font></td></tr><tr><td width='100%'><hr size='1' width='75%'></td></tr><tr><td width='100%'><p align='center'>发送失败, 服务器忙,请稍后再发!</td></tr><tr><td width='100%'><hr size='1' width='75%'></td></tr><tr><td width='100%' align='center'><a href='javascript:history.go(-1);'>返回</a></td></tr><tr><td width='100%'></td></tr></table></td></tr></table></td></tr></table>"
end if
'response.write jmail1.From
end if
<script language=javascript>
function sendto()
{
var subject1="产品订购";
var body1="您的姓名:"+document.myform.username.value; //回车换行的忘了怎么写的,这里去了,测试通过
body1=body1+"公司名称:"+document.myform.Co_name.value;
....
this.location="mailto:hzck@vip.163.com?subject="+subject1+"&body="+body1;
return false;