raksmart活动促销

分享

写回答

发帖

Windows方案下ASP发邮件问题

国外虚拟主机 国外虚拟主机 3183 人阅读 | 3 人回复

发表于 2008-1-3 15:46:00 | 显示全部楼层 |阅读模式

昨天发信问了一下客服,说不能用Jmail组件通过ASP来发邮件,只能是CDOSYS。
Unfortunately we do not support Jmail at this time. We support CDOSYS for sending mail on Windows plans, more information can be found here:
http://www.powerasp.com/content/new/sending_email_cdosys.asp
Please advise if you need further assistance.

但去试了,发送不成功。
不知有哪位是可以用ASP来发送邮件的。请指教。

回答|共 3 个

忧伤b小调

发表于 2008-1-3 22:26:37 | 显示全部楼层

没用过WIN主机,不太清楚.

sumire

发表于 2008-1-4 08:42:19 | 显示全部楼层

WIN不支持MAIL函数

yijintong

发表于 2008-1-4 14:58:49 | 显示全部楼层

忙活了2天,终于搞这定了。
以下是方法的链接:http://www.lunarforums.com/lunarpages_asp/solution_to_using_form_to_send_email_from_asp_page_using_cdosys-t44402.0.html;msg314372#msg314372

内容如下:
Hi,
this is to help others on Windoze hosting plans who may be having problems setting their asp form to send them an email, feedback etc.

I was able to get the CDOSYS script working on my Windoze hosting plan after making the following modifications.  That script can be found under asp in the knowledgebase website of Lunarpages:  https://support.lunarpages.com/knowledge_bases/article/273
Note, my domain name is: ajmasters.com

1 - Make sure the email you use to send FROM does exist with your domain.  i.e. you need to create an email with your domain name.
ex: I created this email:   fromWeb@ajmasters.com
2-  Make sure the email you send TO does exist with your domain.  It did not work when trying to send to an email outside like something@yahoo.com  but it did ok when using my own. i.e. you need to create an email with your domain name.  (you can then set that email to redirect outside if you want)  ex: I created this email:   Tomyself@ajmasters.com
3-  Change the port from 25 to 2 on this line:   Const cdoSendUsingPort = 2

Here is the script below,  make the appropriate changes using your own domain name.


          Dim iMsg
          Dim iConf
          Dim Flds
          Dim strHTML
          Dim strSmartHost
          Const cdoSendUsingPort = 2
          StrSmartHost = "localhost"
          set iMsg = CreateObject("CDO.Message")
          set iConf = CreateObject("CDO.Configuration")
          Set Flds = iConf.Fields
          With Flds
          .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
          .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSmartHost
          .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
          .Update
          End With
          strBody = "This is a test of sending an email via ASP" & vbCrLf & vbCrLf
          strBody = strBody & "This is line 2. " & vbCrLf
          strBody = strBody & "you can have as many as you want" & vbCrLf
          strBody = strBody & "THIS IS AN AUTOMATED EMAIL - PLEASE DO NOT REPLY"
          With iMsg
          Set .Configuration = iConf
          .To = "Tomyself@ajmasters.com"
          .From = "fromWeb@ajmasters.com"
          .Subject = "LEADS FROM MY FORM "
          .textbody = strBody
          'redirect code goes here
          .Send
          End With
          ' cleanup of variables
          Set iMsg = Nothing
          Set iConf = Nothing
          Set Flds = Nothing
中文大致意思如下:
接收 ("fromWeb@ajmasters.com")和 发送("Tomyself@ajmasters.com")的邮箱账号必须是你的域名(ajmasters.com) 的,即是你的用你的域名开通的邮箱账号。
其它的邮箱地址,你可以用转发功能(接收邮箱转发,如例子里的"Tomyself@ajmasters.com")
您需要登录后才可以回帖 登录 | 注册

本版积分规则