godaddy的win主机发邮件的组件

redmaomail 2024-07-25 11:21 阅读数 65 #Godaddy

红帽云邮外贸主机

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


红帽云邮外贸主机

分享到:
版权声明:本站内容源自互联网,如有内容侵犯了你的权益,请联系删除相关内容。
    红帽云邮外贸主机
热门
    红帽云邮外贸主机
    红帽云邮外贸主机