现在的位置: 首页 > Godaddy使用说明 > 正文

godaddy的win主机发邮件的组件

2008年10月22日 使用说明 ⁄ 共 971字 ⁄ 字号 评论 1 条 ⁄ 阅读 3,271 views 次

1 .CDOSYS

代码:

// 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.
%>

目前有 1 条留言    访客:0 条, 博主:0 条

  1. newbalance 2013年11月30日 10:26 下午  Δ-49楼

给我留言

留言无头像?