վҳ   ϵ 
վҳ ע ҵʾ ͨ ܽվ ̬ ҵƽ̨  
վҳ
֧ҳ
ռ
ܽվ
ͨ
̬
ѯ
 

   
�������ASP������ʹ��JMail���ʼ�������
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
if Request("MailtoAddress") <> "" then
��������msg = SendMail
(Request("SMTPServer"),Request("SMTPServerUserName"),Request("SMTPServerPassword"),
Request("MailDomain"),Request("MailtoAddress"),Request("MailtoName"),Request("Subject"),
Request("MailBody"),Request("FromName"),Request("MailFrom"),Request("Priority"))
��������if msg then Response.Write("���ͳɹ�") else Response.Write("���Ͳ��ɹ�")
��������Response.End()
end if
function
SendMail(SMTPServer,SMTPServerUserName,SMTPServerPassword,MailDomain,MailtoAddress,MailtoName,
Subject,MailBody,FromName,MailFrom,Priority)
��������dim JMail, msg
��������set JMail=Server.CreateObject("JMail.Message")
��������JMail.Charset="gb2312" '����
��������JMail.silent=true '����Ϊtrue,JMail�����׳��������.
��������JMail.ContentType = "text/plain" '�ʼ����ĸ�ʽ
��������'JMail.ServerAddress = SMTPServer '���������ʼ���SMTP������(��Ч)
��������'ָ���ʼ��������ĵ�ַ������ָ��������������÷ֺŵ㿪������ָ���˿ںš�
��������'���serverAddress���ֿհף�JMail�᳢�Խ��Զ���ʼ���������Ȼ��ֱ�ӷ��͵���������ȥ��???
��������'�磺JMail.ServerAddress = &tquo;mail.mydom.net; mail2.mydom.net:2500"

��������JMail.MailServerUserName = SMTPServerUserName '��¼�û���
��������JMail.MailServerPassWord = SMTPServerPassword '��¼����
��������JMail.MailDomain = MailDomain '����������á�name@domain.com���������û�����¼ʱ����ָ��domain.com
��������JMail.AddRecipient MailtoAddress,MailtoName '������
��������JMail.Subject = Subject '����
��������JMail.Body = MailBody '�ʼ����ģ����ı���ʽ��
��������JMail.FromName = FromName '����������
��������JMail.From = MailFrom '������Email
��������JMail.Priority = Priority '�ʼ��ȼ�12345
��������msg = JMail.Send(SMTPServer)
��������JMail.Close
��������set JMail = nothing
��������SendMail = msg
end function
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>JMail test</title>
</head>
<body>
<form name="form1" method="post" action="">
��<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#333333">
����<tr bgcolor="#FFFFFF">
<!--
��������<td width="14%"> SMTP��������ַ�� </td>
��������<td width="86%"><input name="SMTPServer" type="text" id="SMTPServer" ����������value="smtp.126.com"></td>
����</tr>
����<tr bgcolor="#FFFFFF">
��������<td height="14" colspan="2">�����SMTP��Ҫ�����֤,����Ҫ��������Ϣ:</td>
����</tr>
����<tr bgcolor="#FFFFFF">
��������<td> SMTP��¼�û����� </td>
��������<td><input name="SMTPServerUserName" type="text" id="SMTPServerUserName" ������������value=""></td>
����</tr>
����<tr bgcolor="#FFFFFF">
��������<td> SMTP��¼���룺 </td>
��������<td><input name="SMTPServerPassword" type="password" id="SMTPServerPassword" ������������value=""></td>
����</tr>
����<tr bgcolor="#FFFFFF">
��������<td> SMTP���� �� </td>
��������<td><input name="MailDomain" type="text" id="MailDomain" value=""></td>
����</tr>
����<tr bgcolor="#FFFFFF">
��������<td>&nbsp;</td>
��������<td>&nbsp;</td>
����</tr>
-->

����<tr bgcolor="#FFFFFF">
��������<td>�ռ�������:</td>
��������<td><input name="MailtoAddress" type="text" id="MailtoAddress"></td>
����</tr>
����<tr bgcolor="#FFFFFF">
��������<td>�ռ���:</td>
��������<td><input name="MailtoName" type="text" id="MailtoName"></td>
����</tr>
����<tr bgcolor="#FFFFFF">
��������<td>����:</td>
��������<td><input name="Subject" type="text" id="Subject"></td>
����</tr>
����<tr bgcolor="#FFFFFF">
��������<td>����:</td>
��������<td><textarea name="MailBody" id="MailBody"></textarea></td>
����</tr>
����<tr bgcolor="#FFFFFF">
��������<td>����������:</td>
��������<td><input name="MailFrom" type="text" id="MailFrom"></td>
����</tr>
����<tr bgcolor="#FFFFFF">
��������<td>������:</td>
��������<td><input name="FromName" type="text" id="FromName"></td>
����</tr>
����<tr bgcolor="#FFFFFF">
��������<td>&nbsp;</td>
��������<td>&nbsp;</td>
����</tr>
����<tr bgcolor="#FFFFFF">
��������<td>�ȼ�:</td>
��������<td><select name="Priority" id="Priority">
����������<option value="5">5</option>
����������<option value="4">4</option>
����������<option value="3" selected>3</option>
����������<option value="2">2</option>
����������<option value="1">1</option>
��������</select></td>
����</tr>
����<tr bgcolor="#FFFFFF">
��������<td colspan="2"><input type="submit" name="Submit" value="�ύ"></td>
����</tr>
��</table>
</form>
</body>
</html>
�� ��
 
  打 印   发 送 时代互联Todaynic.com, Inc. 版权所有 ©2000-2024
《中华人民共和国增值电信业务经营许可证》 ISP证粤B2-20042046