从表单发送电子邮件

时间:2014-04-04 13:34:41

标签: html sql email asp-classic

我正在创建一个系统,用户可以预订日期,这些日子将由不同的人处理。一旦用户进行了预订,我希望处理预订的人员收到一封电子邮件,告知他们已经预订了他们进行预订。我正在使用HTML,ASP经典和SQL(在SQL Server中)。我想知道使用这些语言之一发送电子邮件的最佳方式是什么。我似乎只能找到我不认识的语言的答案,并且希望能够理解已写的内容,如果出现未来的问题,谢谢。

2 个答案:

答案 0 :(得分:0)

您可以尝试这样的事情:

<%
Set Mail=CreateObject("CDO.Message")
Mail.Subject="Email subject"
Mail.From="from@domain.com"
Mail.To=to@domain.com
Mail.ReplyTo ="replyto@domain.com"
Mail.HTMLBody = "<h1>This is an email message.</h1>"
Mail.Send
set Mail=nothing
%>

答案 1 :(得分:0)

这是我的问题的答案,另一个答案没有用,因为它没有设置SMPT服务器,这就是我现在使用的:

Set myMail=CreateObject("CDO.Message")
myMail.Subject="SUBJECT"
myMail.From="FROM EMAIL"
myMail.To="TO EMAIL"
myMail.TextBody= "TEXT BODY"
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver")="exchangeremote.webappuk.com"
'Server port
 myMail.Configuration.Fields.Item _
 ("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25 
 myMail.Configuration.Fields.Update
 myMail.Send
 set myMail=nothing