欢迎来到入门教程网!

编程问答

当前位置:主页 > 网络编程 > 编程问答 >

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

来源:本站原创|时间:2020-01-11|栏目:编程问答|点击:

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

JMailUploadAutoForm.asp
<html>
<body>
<font face="verdana, arial" size="2">
<form method="post" action="JmailUploadAutoFormProcess.asp" ENCTYPE="multipart/form-data">
<p>
撼雪喷云之动发送电子邮件</p><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

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

<br><br>
您的姓名<br>
<input type="text" size="25" name="name"><br>
电子邮件地址<br>
<input type="text" size="25" name="email"><br>
接收邮件地址<br>
<input type="text" size="25" name="recipient"><br>

您想...<br>
<select name="subject" size="1">
<option value="help">
咨询
<option value="hello">
问候
<option value="other">
其它
</select>
<br>
主题<br>
<input type="text" size="25" name="tipic"><br>
概述<br>
<input type="text" size="25" name="resume"><br>

请输入您的内容<br>
<textarea name="question" cols="40" rows="15" wrap="PHYSICAL"></textarea>
<br>
<br>
<br>

附件1<br>
<input type="file" name="attachment1">
<br>
<br>
附件2<br>
<input type="file" name="attachment2">
<br>
<br>
附件3<br>
<input type="file" name="attachment3">
<br>
<br>
<input type="submit" value="
发送">
</form>
感谢光临随风起舞!
</font>
</body></html>

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

%>
<html>
<body>
<BR>
<BR>
<p align="center"><font face="Arial, geneva" size="5">
邮件发送成功!</font></p>
<center>
<font face="Arial, geneva" size="3">
您的邮件已发送至<%= Recipient %><br>
<BR>
</font>
</center>
</body></html>

 

 

 

[1]

上一篇:如何实现电子邮件的自动发送?

栏    目:编程问答

下一篇:如何使图象随机显示?

本文标题:如何用组件实现自动发送电子邮件?

本文地址:https://www.xiuzhanwang.com/a1/bianchengwenda/12085.html

网页制作CMS教程网络编程软件编程脚本语言数据库服务器

如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:835971066 | 邮箱:835971066#qq.com(#换成@)

Copyright © 2002-2020 脚本教程网 版权所有