现在做java了,到时候发些java的文章

现在做java了,到时候发些java的文章

博客园 首页 新随笔 联系 订阅 管理
  55 Posts :: 11 Stories :: 2 Comments :: 0 Trackbacks

公告

1 CDOSYS
The server "relay-hosting.secureserver.net" is used to send email fromyour hosted domain. You must populate the SmtpMail object's SmtpServerproperty with this value. Our shared hosting servers allow for emailattachments up to 30 MB.
复制内容到剪贴板
代码:
// language -- C#
// import namespace
using System.Web.Mail;

private void SendEmail()
{
   const string SERVER = "relay-hosting.secureserver.net";
   MailMessage oMail = new System.Web.Mail.MailMessage();
   oMail.From = "emailaddress@domainname";
   oMail.To = "emailaddress@domainname";
   oMail.Subject = "Test email subject";
   oMail.BodyFormat = MailFormat.Html; // enumeration
   oMail.Priority = MailPriority.High; // enumeration
   oMail.Body = "Sent at: " + DateTime.Now;
   SmtpMail.SmtpServer = SERVER;
   SmtpMail.Send(oMail);
   oMail = null; // free up resources
}
参考http://help.godaddy.com/article/1073
2  CDONTS.NewMail
复制内容到剪贴板
代码:
<%
from = request.form("from")
body = request.form("body")
subject = request.form("subject")
%>

<%
Dim objMail
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = from
objMail.Subject = subject
objMail.To = "hard-code your email address"
objMail.Body = body
objMail.Send

Set objMail = Nothing
Response.redirect "thankyou.asp" '<- auto-redirection
'You must always do this with CDONTS.
'Change the page name to one that exists on your site.
%>
iis7.0下的代码示例
复制内容到剪贴板
代码:
<%
Dim MyBody
Dim MyCDONTSMail

Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
MyCDONTSMail.From= "sender@coolexample.com"
MyCDONTSMail.To= "recipient@coolexample.com"
MyCDONTSMail.Subject="Subject"
MyBody = "Body"
MyCDONTSMail.Body= MyBody
MyCDONTSMail.Send

set MyCDONTSMail=nothing
%>
[ 本帖最后由 add.c 于 2008-7-17 10:29 AM 编辑 ]
posted on 2009-03-11 15:56 panzhilei 阅读(217) 评论(0) 编辑 收藏