首页 > 互联资讯 > 技术交流  > 

如何用组件实现自动发送电子邮件?

如何用组件实现自动发送电子邮件?

JMailUploadAutoForm.asp




撼雪喷云之动发送电子邮件

请填写好表单,点击发送!




您的姓名



电子邮件地址



接收邮件地址




您想...




主题



概述




请输入您的内容









附件1






附件2






附件3






发送
">

感谢光临随风起舞!



JmailUploadAutoFormProcess.asp
<%
Set upload = Server.CreateObject( "w3.Upload" )
Set JMail = Server.CreateObject("JMail.SMTPMail")

for i = 0 to upload.form.count-1
if upload.form( i ).isFile then
set attachment = upload.Form( i )
JMail.AddCustomAttachment attachment.filename, attachment.item

' 检查附件并加入邮件.所有其他的form元素被加到邮件里.
else
JMail.appendtext( upload.form( i ).name & ": " & upload.form( i ).item & vbcrlf )
end if
next

Name = upload.Form("name")
SenderEmail = upload.Form("email")
Subject = "Regarding " & upload.Form("subject")
Recipient = upload.Form("recipient")

' 得到form变量,用上传组件.

JMail.ServerAddress = "mail.intels.net"
'
输入你的SMTP-server.

JMail.Sender = Senderemail
JMail.Subject = Subject
JMail.AddRecipient Recipient
JMail.Priority = 3

JMail.Execute

%>







邮件发送成功!




您的邮件已发送至<%= Recipient %>





[1]

如何用组件实现自动发送电子邮件?由讯客互联技术交流栏目发布,感谢您对讯客互联的认可,以及对我们原创作品以及文章的青睐,非常欢迎各位朋友分享到个人网站或者朋友圈,但转载请说明文章出处“如何用组件实现自动发送电子邮件?