我觉得我在这里遗漏了一些东西。我在 vbscript 中添加了一些不同的东西,试图让它只在单击提交按钮而不是两次时运行(第二次加载页面,然后提交),但它要么坏了它,要么没有用。对这个初学者程序员的任何帮助将不胜感激。如果您需要html,请告诉我。编辑:仍在寻求帮助!:(
<% Sub sendEmail(mailFrom, mailTo, mailSubject, mailMessage, mailServer, mailUsername, mailPassword)
Set MyMail = CreateObject("cdo.message")
MyMail.From = mailFrom
MyMail.To = mailTo
MyMail.Subject = mailSubject
MyMail.HTMLBody = mailMessage
MyMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
MyMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = mailServer
MyMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = mailUsername
MyMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = mailPassword
MyMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
MyMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
MyMail.Configuration.Fields.Update
MyMail.Send
Set MyMail = nothing
End Sub
Dim mailFrom, mailTo, mailSubject, mailMessage, mailServer, mailUsername, mailPassword
mailFrom = Request.form(example)
mailTo = "example"
mailSubject = "example"
mailMessage = "example"
mailServer = "example"
mailUsername = "example"
mailPassword = "example"
Call sendEmail(mailFrom, mailTo, mailSubject, mailMessage, mailServer, mailUsername, mailPassword)
%>