<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<META NAME="GENERATOR" CONTENT="Mozilla/4.03 [en] (Win95; I) [Netscape]">
<script language="javascript">
<!--
var content="plain";
function setText()
{
today=new Date;
year=today.getYear();
if(year<100)year+=1900;
str="星期*:\n 你好,你的Java Mail程序很不错.\n希望你能写出更好的软件来.\n\n 你的朋友\n "+year+"-"+(today.getMonth()+1)+"-"+today.getDate();
document.mail.setMessage(str);
}
function send()
{
for(i=0;i<3;i++)
{
if(document.form1.Priority.options[i].selected)
level=document.form1.Priority.options[i].value;
}
if(document.mail.getFromAddress()=="")
{alert("发信人地址不能为空.");return;}
if(document.mail.getRecipientAddress()=="")
{alert("收信人地址不能为空.");return;}
msg=document.mail.getPrivateMSG();
newmsg="MIME-Version: 1.0\r\nContent-Type: text/"+content+"\r\nX-Priority: "+level+"\r\nContent-Transfer-Encoding: 8bit\r\n"+msg;
document.mail.setPrivateMSG(newmsg);
self.status="正在发送信件,请稍候......";
document.mail.send();
document.mail.setPrivateMSG(msg);
if(document.mail.getStatus())
{self.status="发送成功.";alert("信件发送完毕!");}
else{self.status="发送失败.";alert("信件发送失败\n失败原因请查看纪录.");}
}
//-->
</script>
</HEAD>
<BODY onload="setText()">
JMail.class应用举例
<BR>如果您愿意的话,请在你的主页上增加一个指向作者主页的链接,作者的主页是<A HREF="http://yesican.126.com/" target="_top">http://yesican.126.com/</A>,非常感谢
!
<P><applet name="mail" codebase="http://jinhu.163.net/" code="JMail.class" width=350 height=400>
<param name=port value="25">
<param name=senderhost value="anonymous.com">
<param name=mail_from value="your e-mail address">
<param name=rcpt_to value="yesican@21cn.com">
<param name=subject value="你好">
<param name=nobutton value="yes">
<param name=privateMSG value="Information: 欢迎使用Java mail2.1, 作者:星期*">
<param name=msg value="your message">
</applet>
<form name="form1">
发送方式:
<br> <input type="radio" checked name="Content" value="plain" ONCLICK="content='plain';">按文本方式发送
<input type="radio" name="Content" value="html" ONCLICK="content='html';">按HTML方式发送
<br>发送优先级:
<br> <select name="Priority" size="1">
<option value="1">高优先级</option>
<option Selected value="3">一般优先级</option>
<option value="5">低优先级</option>
</select>
<p><input type="button" name="Send" value=" 发送 " ONCLICK="send()">
<input type="button" name="Viewlog" value=" 查看纪录 " ONCLICK="alert(document.mail.getLog())"></p>
</form>
</BODY>
</HTML>
通过OutlookExpress发邮件
4星 · 超过85%的资源 需积分: 50 185 浏览量
2002-08-14
00:00:00
上传
评论 1
收藏 4KB ZIP 举报
普通网友
- 粉丝: 882
- 资源: 2万+
- 1
- 2
前往页