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.
2 CDONTS.NewMail
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.
复制内容到剪贴板
参考
http://help.godaddy.com/article/1073
代码:
// 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
复制内容到剪贴板
iis7.0下的代码示例
代码:
<%
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.
%>
复制内容到剪贴板
[
本帖最后由 add.c 于 2008-7-17 10:29 AM 编辑 ]
代码:
<%
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
%>