技术求助~~~~~~~~!!急~~~~!
是这样滴,我现在有个在线填写的反馈单,填写完发送指定邮箱,ASP做的,是需要服务器JMAIL组件支持滴那种。做完测试功能一切正常。但是现在这个网站是在国外使用,而国外用的这个godaddy服务器不支持JMAIL,只能用CDONTS.NewMail。对面也发送过来相应解决方案,我找朋友帮忙改了下,但是在国内服务器上测试还是发送不了邮箱。恳请这里的朋友帮忙解决一下,如有好心人,请加我QQ:16263747。
测试地址:
http://www.
=======================================================================================
这是最早的JMAIL方案:
<%
act=request("act")
if act="sendmail" then
call sendmail
else
call sendmail2
end if
sub sendmail
dim mail
set mail=server.CreateObject("Jmail.Message")
mail.Logging=true
mail.MailDomain="smtp. 'smtp服务器
mail.MailServerUserName="xiaobo_2009@ '用户名
mail.MailServerPassword="123" '密码
mail.AddRecipient "xiaobo_2009@
mail.Charset="GB2312"
mail.AddHeader "Originating-IP",Request.ServerVariables("REMOTE_ADDR")
mail.AddNativeHeader "MTA-Settings","route"
mail.From="xiaobo_2009@ '发件人地址
mail.Subject="本邮件来自xiaobo_2009@[发送时间:" & "(" & Now & ")]" '主题
mail.Body="这是一封htm格式的邮件,请用web方式浏览。" '文本内容
mail.HtmlBody="<table width=568 border=1 >" 'html内容
mail.HtmlBody=mail.HtmlBody & "<tr><td align=center>VEUILLEZ BIEN REMPLIR LE FORMULAIRE CI-DESSOUS</td></tr>"
mail.HtmlBody=mail.HtmlBody & "<tr><td>"
mail.HtmlBody=mail.HtmlBody & "Nom:" & request("Nom") & "<br>"
mail.HtmlBody=mail.HtmlBody & "Vous êtes:" & request("Vous êtes") & "<BR>"
mail.HtmlBody=mail.HtmlBody & "Téléphone:" & request("Téléphone") & "<BR>"
mail.HtmlBody=mail.HtmlBody & "Email:" & request("Email") & "<BR>"
mail.HtmlBody=mail.HtmlBody & "Type de travaux:" & request("Neuf1") & "<BR>"
mail.HtmlBody=mail.HtmlBody & "Description des travaux:" & request("content") & "<BR>"
mail.HtmlBody=mail.HtmlBody & "</table>"
mail.silent=true
if mail.send(mail.MailDomain)=false then
response.Write("邮件发送错误<br>" & "错误代码:" & mail.ErrorCode & "<BR>错误描述:" & mail.ErrorMessage & "<br>下面是发送记录,供技术人员调试:<p>" & replace(mail.log,chr(13),"<br>") & "</p>")
exit sub
else
response.Write("<script language=javascript>alert('您提交的信息已经成功发送xiaobo_2009@,我们会尽快处理您提交的内容。');location.href='Devis.asp';</script>")
end if
mail.ClearRecipients
end sub
%>
=================================================================================================
国外那边发过来的解决参考:
1.CDOSYS
// language -- C#
// import namespace
using System.Web.Mail;
private void SendEmail()
{
const string SERVER = "relay-hosting.
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.
%>
3. iis7.0下的代码示例
<%
Dim MyBody
Dim MyCDONTSMail
Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
MyCDONTSMail.From= "sender@
MyCDONTSMail.To= "recipient@
MyCDONTSMail.Subject="Subject"
MyBody = "Body"
MyCDONTSMail.Body= MyBody
MyCDONTSMail.Send
set MyCDONTSMail=nothing
%>
===============================================================================================
我现在的解决方法,但还是测试不成功。
<%
act=request("act")
if act="sendmail" then
call sendmail
end if
sub sendmail
dim mail
set mail=server.CreateObject("CDONTS.NewMail")
mail.From= "xiaobo_2009@
mail.To="xiaobo_2009@
mail.Subject="本邮件来自xiaobo_2009@[发送时间:" & "(" & Now & ")]"
mail.BodyFormat=0
mail.MailFormat=0
mail.Body="这是一封htm格式的邮件,请用web方式浏览。" '文本内容
mail.Body="<table width=568 border=1 >" 'html内容
mail.Body=mail.Body & "<tr><td align=center>VEUILLEZ BIEN REMPLIR LE FORMULAIRE CI-DESSOUS</td></tr>"
mail.Body=mail.Body & "<tr><td>"
mail.Body=mail.Body & "Nom:" & request("Nom") & "<br>"
mail.Body=mail.Body & "Vous êtes:" & request("Vous êtes") & "<BR>"
mail.Body=mail.Body & "Téléphone:" & request("Téléphone") & "<BR>"
mail.Body=mail.Body & "Email:" & request("Email") & "<BR>"
mail.Body=mail.Body & "Type de travaux:" & request("Neuf1") & "<BR>"
mail.Body=mail.Body & "Description des travaux:" & request("content") & "<BR>"
mail.Body=mail.Body & "</table>"
mail.Send
response.Write("<script language=javascript>alert('您提交的信息已经成功发送xiaobo_2009@,我们会尽快处理您提交的内容。');location.href='Devis.asp';</script>")
Set mail = nothing
'mail.Logging=true
'mail.MailDomain="smtp. 'smtp服务器
'mail.MailServerUserName="xiaobo_2009@ '用户名
'mail.MailServerPassword="123" '密码
'mail.AddRecipient "xiaobo_2009@
'mail.Charset="GB2312"
'mail.AddHeader "Originating-IP",Request.ServerVariables("REMOTE_ADDR")
'mail.AddNativeHeader "MTA-Settings","route"
'mail.From="xiaobo_2009@ '发件人地址
'mail.Subject="本邮件来自xiaobo_2009@[发送时间:" & "(" & Now & ")]" '主题
'mail.Body="这是一封htm格式的邮件,请用web方式浏览。" '文本内容
'mail.HtmlBody="<table width=568 border=1 >" 'html内容
'mail.HtmlBody=mail.HtmlBody & "<tr><td align=center>VEUILLEZ BIEN REMPLIR LE FORMULAIRE CI-DESSOUS</td></tr>"
'mail.HtmlBody=mail.HtmlBody & "<tr><td>"
'mail.HtmlBody=mail.HtmlBody & "Nom:" & request("Nom") & "<br>"
'mail.HtmlBody=mail.HtmlBody & "Vous êtes:" & request("Vous êtes") & "<BR>"
'mail.HtmlBody=mail.HtmlBody & "Téléphone:" & request("Téléphone") & "<BR>"
'mail.HtmlBody=mail.HtmlBody & "Email:" & request("Email") & "<BR>"
'mail.HtmlBody=mail.HtmlBody & "Type de travaux:" & request("Neuf1") & "<BR>"
'mail.HtmlBody=mail.HtmlBody & "Description des travaux:" & request("content") & "<BR>"
'mail.HtmlBody=mail.HtmlBody & "</table>"
'mail.silent=true
'if mail.send(mail.MailDomain)=false then
'response.Write("邮件发送错误<br>" & "错误代码:" & mail.ErrorCode & "<BR>错误描述:" & mail.ErrorMessage & "<br>下面是发送记录,供技术人员调试:<p>" & replace(mail.log,chr(13),"<br>") & "</p>")
'exit sub
'else
'response.Write("<script language=javascript>alert('您提交的信息已经成功发送xiaobo_2009@,我们会尽快处理您提交的内容。');location.href='Devis.asp';</script>")
'end if
'mail.ClearRecipients
end sub
%>