如何让表单提交到数据库里或直接发送到邮箱里?
1个回答
展开全部
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
dim uname,title,user_addr,BusinessType,user_tel,email,user_fax,user_code,content
tomail=request("tomail")
company=request("sender_com")
uname=request("sender_name")
title=request("mail_title")
user_addr=request("sender_add")
BusinessType=request("chk_BusinessType")
other=request("other")
country=request("sender_country")
user_tel=request("sender_tel")
email=request("sender_mail")
user_fax=request("sender_fax")
content=request("mail_content")
Request.ServerVariables("SERVER_NAME")
Dim msg
Dim email_server,user_name,password,Email_type,send_email
email_server ="邮箱"
user_name ="用户名"
password ="密码"
Email_type =1
send_email ="发送的邮箱"
ToWho="收到的邮箱"
Set msg=Server.CreateObject("JMail.Message")
msg.Body = "你好!您有一封来自"&email&"的邮件,请注意查收!"&chr(10) &"发信单位:"& company &chr(10) &"发信人:"& uname &chr(10) &"电话:"& user_tel &chr(10)&"传真:" & user_fax &chr(10) &"邮箱:"& email &chr(10) &"国家:"& country &chr(10)&"地址:"& user_addr&chr(10)&"以下为邮件的内容:"&chr(10) '邮件的内容
msg.HTMLBody = ""
'---
msg.appendtext(Content)
if user_name<>"" and password<>"" then
msg.MailServerUserName = user_name
msg.MailServerPassword = password
end if
if ToWho<>"" then msg.ReplyTo=ToWho
'--
msg.Logging = True
msg.silent = true
msg.Charset = "utf-8"
msg.From =email
msg.From = email
msg.From =send_email
msg.Subject = title
'--
msg.AddRecipient ToWho
msg.Priority=Email_type
err=msg.Send (email_server)
'---
msg.clear
msg.close
Set msg=nothing
response.write "<script>alert('邮件发送成功!');location.replace('javascript:history.back(-1);');</script>"
%>
<%
dim uname,title,user_addr,BusinessType,user_tel,email,user_fax,user_code,content
tomail=request("tomail")
company=request("sender_com")
uname=request("sender_name")
title=request("mail_title")
user_addr=request("sender_add")
BusinessType=request("chk_BusinessType")
other=request("other")
country=request("sender_country")
user_tel=request("sender_tel")
email=request("sender_mail")
user_fax=request("sender_fax")
content=request("mail_content")
Request.ServerVariables("SERVER_NAME")
Dim msg
Dim email_server,user_name,password,Email_type,send_email
email_server ="邮箱"
user_name ="用户名"
password ="密码"
Email_type =1
send_email ="发送的邮箱"
ToWho="收到的邮箱"
Set msg=Server.CreateObject("JMail.Message")
msg.Body = "你好!您有一封来自"&email&"的邮件,请注意查收!"&chr(10) &"发信单位:"& company &chr(10) &"发信人:"& uname &chr(10) &"电话:"& user_tel &chr(10)&"传真:" & user_fax &chr(10) &"邮箱:"& email &chr(10) &"国家:"& country &chr(10)&"地址:"& user_addr&chr(10)&"以下为邮件的内容:"&chr(10) '邮件的内容
msg.HTMLBody = ""
'---
msg.appendtext(Content)
if user_name<>"" and password<>"" then
msg.MailServerUserName = user_name
msg.MailServerPassword = password
end if
if ToWho<>"" then msg.ReplyTo=ToWho
'--
msg.Logging = True
msg.silent = true
msg.Charset = "utf-8"
msg.From =email
msg.From = email
msg.From =send_email
msg.Subject = title
'--
msg.AddRecipient ToWho
msg.Priority=Email_type
err=msg.Send (email_server)
'---
msg.clear
msg.close
Set msg=nothing
response.write "<script>alert('邮件发送成功!');location.replace('javascript:history.back(-1);');</script>"
%>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询