当前位置: 首页 > news >正文

无锡工程建设招标网站建e网效果图怎么下载

无锡工程建设招标网站,建e网效果图怎么下载,国外设计师个人网站,网站建站代理加盟最近使用.net的System.Web.Mail发送邮件在服务器上失败,经过多次尝试,终于解决了这个问题: 一般System.Web.Mail是.net自带的发送邮件的库.但发现失败的原因有几种,贴出来给大家参考一下: % Page LanguageC# % script languageC# runat% Page LanguageC# % script languageC# runatserver void Page_Load() { // 使用一个SMTP的服务器并且通过验证  System.Web.Mail.MailMessage myEmail new System.Web.Mail.MailMessage();  myEmail.From username126.com; myEmail.To aimeyou.com; myEmail.Subject 测试; myEmail.BodyFormat System.Web.Mail.MailFormat.Text; myEmail.Body 看到了么; // 通过SMTP服务器验证 myEmail.Fields.Add(http://schemas.microsoft.com/cdo/configuration/smtpauthenticate, 1); myEmail.Fields.Add(http://schemas.microsoft.com/cdo/configuration/sendusername, username); myEmail.Fields.Add(http://schemas.microsoft.com/cdo/configuration/sendpassword, userpassword); System.Web.Mail.SmtpMail.SmtpServer smtp.126.com; System.Web.Mail.SmtpMail.Send(myEmail); lblMailStatus.Text Mail successfully sent.; } /script html body asp:Label idlblMailStatus runatserver / /body /html 这个是常见的发送方式, 案例一:见到网上有些资料缺少 // 通过SMTP服务器验证 myEmail.Fields.Add(http://schemas.microsoft.com/cdo/configuration/smtpauthenticate, 1); myEmail.Fields.Add(http://schemas.microsoft.com/cdo/configuration/sendusername, username); myEmail.Fields.Add(http://schemas.microsoft.com/cdo/configuration/sendpassword, userpassword); 这一部分,是失败原因其中之一.有些邮件服务器(smtp)需要用户验证. 附CdoConfiguration相关属性参考:(转自:http://dev.csdn.net/article/78/78245.shtm)public abstract class CdoConfiguration{      // Fields      [MarshalAs(UnmanagedType.BStr)]      public const string cdoAutoPromoteBodyParts http://schemas.microsoft.com/cdo/configuration/autopromotebodyparts;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoFlushBuffersOnWrite http://schemas.microsoft.com/cdo/configuration/flushbuffersonwrite;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoHTTPCookies http://schemas.microsoft.com/cdo/configuration/httpcookies;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoLanguageCode http://schemas.microsoft.com/cdo/configuration/languagecode;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoNNTPAccountName http://schemas.microsoft.com/cdo/configuration/nntpaccountname;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoNNTPAuthenticate http://schemas.microsoft.com/cdo/configuration/nntpauthenticate;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoNNTPConnectionTimeout http://schemas.microsoft.com/cdo/configuration/nntpconnectiontimeout;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoNNTPServer http://schemas.microsoft.com/cdo/configuration/nntpserver;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoNNTPServerPickupDirectory http://schemas.microsoft.com/cdo/configuration/nntpserverpickupdirectory;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoNNTPServerPort http://schemas.microsoft.com/cdo/configuration/nntpserverport;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoNNTPUseSSL http://schemas.microsoft.com/cdo/configuration/nntpusessl;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoPostEmailAddress http://schemas.microsoft.com/cdo/configuration/postemailaddress;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoPostPassword http://schemas.microsoft.com/cdo/configuration/postpassword;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoPostUserName http://schemas.microsoft.com/cdo/configuration/postusername;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoPostUserReplyEmailAddress http://schemas.microsoft.com/cdo/configuration/postuserreplyemailaddress;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoPostUsingMethod http://schemas.microsoft.com/cdo/configuration/postusing;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoSaveSentItems http://schemas.microsoft.com/cdo/configuration/savesentitems;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoSendEmailAddress http://schemas.microsoft.com/cdo/configuration/sendemailaddress;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoSendPassword http://schemas.microsoft.com/cdo/configuration/sendpassword;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoSendUserName http://schemas.microsoft.com/cdo/configuration/sendusername;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoSendUserReplyEmailAddress http://schemas.microsoft.com/cdo/configuration/senduserreplyemailaddress;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoSendUsingMethod http://schemas.microsoft.com/cdo/configuration/sendusing;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoSMTPAccountName http://schemas.microsoft.com/cdo/configuration/smtpaccountname;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoSMTPAuthenticate http://schemas.microsoft.com/cdo/configuration/smtpauthenticate;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoSMTPConnectionTimeout http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoSMTPServer http://schemas.microsoft.com/cdo/configuration/smtpserver;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoSMTPServerPickupDirectory http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoSMTPServerPort http://schemas.microsoft.com/cdo/configuration/smtpserverport;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoSMTPUseSSL http://schemas.microsoft.com/cdo/configuration/smtpusessl;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoURLGetLatestVersion http://schemas.microsoft.com/cdo/configuration/urlgetlatestversion;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoURLProxyBypass http://schemas.microsoft.com/cdo/configuration/urlproxybypass;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoURLProxyServer http://schemas.microsoft.com/cdo/configuration/urlproxyserver;      [MarshalAs(UnmanagedType.BStr)]      public const string cdoUseMessageResponseText http://schemas.microsoft.com/cdo/configuration/usemessageresponsetext;}例子代码如下:   MailMessage myMail new MailMessage();   myMail.From emailFrom;   myMail.To emailTo;   myMail.Subject subject;   myMail.Body sb.ToString();   myMail.BodyFormat MailFormat.Html;   myMail.Fields.Add(http://schemas.microsoft.com/cdo/configuration/sendusing,2);   myMail.Fields.Add(http://schemas.microsoft.com/cdo/configuration/sendemailaddress,emailFrom);   myMail.Fields.Add(http://schemas.microsoft.com/cdo/configuration/smtpuserreplyemailaddress,emailFrom);   myMail.Fields.Add(http://schemas.microsoft.com/cdo/configuration/smtpaccountname,userName);   myMail.Fields.Add(http://schemas.microsoft.com/cdo/configuration/sendusername,Your 163.coms userName);   myMail.Fields.Add(http://schemas.microsoft.com/cdo/configuration/sendpassword,your 163.coms password);   myMail.Fields.Add(http://schemas.microsoft.com/cdo/configuration/smtpauthenticate,1);   myMail.Fields.Add(http://schemas.microsoft.com/cdo/configuration/smtpserver,smtp.163.com);   //SmtpMail.SmtpServer smtp.163.com;   SmtpMail.Send(myMail); 案例二: 已经加上smtp验证,仍然发送失败:原因应该是IIS的设置 运行后系统提示错误信息 Email FailCould not access CDO.Message object.Here is the full error message output:System.Web.HttpException: Could not access CDO.Message object. --- System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. --- System.Runtime.InteropServices.COMException (0x8004020F): The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay for 12321323mobile.att.net 检查SMTP SERVICE正常估计是权限设置问题。打开IIS ADMIN右键点击SMTP VIRTUAL SERVER选择属性在ACCESS中点RELAY增加127.0.0.1。一路OK回去。 这时候再运行程序邮件发送成功。 转自:http://blog.joycode.com/cafecat/archive/2004/11/06/38186.aspx 案例三,就是我所遇到的问题,和同事调试多次之后才发现:服务器为了安全,把一些控件(dll)禁用了. 抛出无法加载Dll的错误. 最后发现,发送邮件需要调用到msado15.dll.而ADO被禁用.导致出错. 希望这些能帮到使用System.Web.Mail的人:)
http://www.w-s-a.com/news/368535/

相关文章:

  • 网站建设丶金手指专业旅游网站系统哪个好
  • 苏州工业园区两学一做网站成都企业排名
  • 医药网站开发wordpress境外支付
  • 营销自己的网站网站如何做标题优化
  • 玖云建站系统wordpress nodejs版本
  • 网站开发费用计入什么二级科目重庆企业网站推广
  • wordpress 菜单怎么使用方法宜春网站推广优化
  • dede 网站图标怎么自学建筑设计
  • 河北斯皮尔网站建设做微信小程序和做网站
  • 沈阳市住房和城乡建设局网站创意上海专业网站建设
  • 免费学编程国内网站it需要什么学历
  • 相城做网站的公司网站建设范本
  • 怎么样查中企动力做的网站阿里邮箱企业版手机版
  • 电子商务网站建设与管理试卷6江门网站建设联系电话
  • 公司的网站建设做什么费用四川圣泽建设集团有限公司网站
  • 为什么网站很少做全屏福利WordPress网站自动采集源码
  • 网站备案法律diy
  • 淘宝客如何新建网站物业管理系统app
  • 品牌网站建设策重大军事新闻视频
  • 廊坊建设网站的公司wordpress清理无用缩略图
  • 桓台网站建设公司首钢建设二建设公司网站
  • 网站建设添加背景命令前端如何优化网站性能
  • 设置网站域名中山画册设计公司
  • 三更app下载网站东莞网站制作公
  • 做图书馆网站模板网站建设文化策划方案
  • 惠州城乡住房建设厅网站服装设计自学零基础
  • 网站建设常态化工作机制广州骏域网络
  • h5婚纱摄影网站模板wordpress 显示下列项目
  • 广告网站推广销售北京最新消息发布
  • 完整网站源码asp拨打12355可以找团员密码吗