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

godaddy的win主机发邮件的组件

2008年10月22日 使用说明 ⁄ 共 911字 ⁄ 字号 godaddy的win主机发邮件的组件已关闭评论 ⁄ 阅读 3,342 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
}

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

抱歉!评论已关闭.