[英]asp formmail auto responder
I'm very bad at coding 我很不擅长编码
i have a asp formmail for subscribe email. 我有一个asp formmail用于订阅电子邮件。 I do get emails but I want to send a autoresponse saying "Thank you for subscription".
我确实收到电子邮件,但是我想发送一个自动回复,说“谢谢您的订阅”。 Also the same for my contact page formmail.
我的联系页面formmail也相同。
Below is my current code can you tell me how do I go about the same. 以下是我当前的代码,您能告诉我如何执行相同操作。
<%
dim sEmailContent
sEmailContent = sEmailContent & "Subscribe : " & Request.Form("subscribe") & vbCrLf
Response.Write(sEmailContent)
'call send_email("here@herringboneandsui.com",sEmailContent)
call send_email("here@herringboneandsui.com",sEmailContent)
function send_email(sToEmail,sEmailBody)
on error resume next
Dim ObjSendMail
Set ObjSendMail = CreateObject("CDO.Message")
'Configuration for remote SMTP server
'Network Send
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name of SMTP server
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="relay-hosting.secureserver.net"
'SMTP port
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
'MaxESP SMTP servers require authentication
'Basic Authentication
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
'SMTP username as configured in the control panel
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="bla@bla.com"
'SMTP user password as configured in the control panel
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="blabla"
ObjSendMail.Configuration.Fields.Update
'Configuration for email message
'Email To address
'ObjSendMail.To = "bla@gmail.com"
'ObjSendMail.To = "bla@mac.com"
ObjSendMail.To = sToEmail
'Email Subject
ObjSendMail.Subject = "Newsletter Subscription"
'Email From address
ObjSendMail.From = "bla@herringboneandsui.com"
'Email Body
ObjSendMail.TextBody = sEmailBody
ObjSendMail.Send
Set ObjSendMail = Nothing
response.Redirect("thank-you.html")
if err.number <> 0 then
Response.Write(err.Description)
end if
on error goto 0
end function
%>
move your function function send_email(sToEmail,sEmailBody)
into separate file, let's say into "Emails.asp". 将您的函数
function send_email(sToEmail,sEmailBody)
移到单独的文件中,比方说到“ Emails.asp”中。
in contact page and in subscribe asp pages add following line to include your "Email.asp" 在联系页面和订阅asp页面中添加以下行以包含“ Email.asp”
<!-- #include file="Emails.asp" -->
then call send_email
as before 然后像以前一样调用
send_email
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.