一共就两个文件。这是发送页面的完整代码:
<%
If Request("To") <> Empty Then
mailto = Request("To")
subject = "嗨!快来吧."
msg = "朋友,你好!" & chr(13) & chr(13) & " 快来看看吧"
if SendMail(mailto,subject,msg) then
Response.Write "
邮件已送出! 谢谢您的推荐!!!"
else
Response.Write "
邮件没有发送成功,请您稍后再试..."
end if
Else
%>
<%
End If
%>
这是用来发送的包含文件send.asp的代码:
<%
dim CLStr,msg,mailserver,username,password
CLStr=Chr(13) & Chr(10)
'请在此修改相关信息
mailserver="mail.123.com" '邮局服务器地址(smtp服务器地址)
username="123@123.com" 'smtp服务器验证登陆名(邮局中开设的任何一个信箱的地址)
password="123456" 'smtp服务器验证密码 (信箱密码)
receive="123@123.com" '接受反馈信息的email地址(可以是您的任何有效信箱)
'修改结束
Set msg = Server.CreateObject("JMail.Message")
msg.silent = true
msg.Logging = true
msg.Charset = "gb2312"
msg.MailServerUserName = username
msg.MailServerPassword = password
msg.From = username
msg.FromName = username
msg.AddRecipient (mailto)
mailto=Request.Form("To")
msg.Subject = Request.Form("Subject")
msg.Body = "msg"
msg.Send (mailserver)
msg.close
set msg = nothing
%>
请求帮忙。谢谢