唉,我的经验已经到头并请求帮助。到目前为止,我已经跟着从这篇文章 www.4guysfromrolla/的说明WEBTECH / 080801-1.shtml 。我唯一的问题是,它编译罚款,但没有电子邮件到达。我有一种感觉它是这离我而去明显的原因。
Alas, my experience has reached an end and request help. So far I've followed the instructions from this article www.4guysfromrolla/webtech/080801-1.shtml . My only problem is It compiles fine but no email arrives. I have a feeling it's for obvious reasons which escape me.
这是我的aspx.vb page.................................................................................................................
This is my aspx.vb page.................................................................................................................
Imports System.Web.Mail Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click Const ToAddress As String = "paul.ramirez@att" Dim objMM As New MailMessage("paramireze@gmail", ToAddress) Dim smtp As New SmtpClient objMM.IsBodyHtml = False objMM.Priority = MailPriority.Normal objMM.Subject = "Hello there!" objMM.Body = "Hi!" & vbCrLf & vbCrLf & "How are you doing?" smtp.Send(objMM) end sub..........................................................................................................................................................
..........................................................................................................................................................
我的aspx页面包含以下... W / O括号(<%@导入命名空间=System.Web.Mail%GT; )
my aspx page contains the following ...w/o the parenthesis (<%@Import Namespace="System.Web.Mail" %>)
web.config文件如下(遗憾的是它不会大于小于符号显示。
The web.config file is as follows(unfortunately it won't display with greater than less than symbols.
<configSections> <system> <mailSettings> <smtp> <network host="relay-hosting.secureserver" port="25"> </smtp> </mailSettings> </system> </configSections>在godaddy的人告诉我,我需要的唯一信息是relayServer主机名是relay-hosting.secureserver和不要求用户名和密码。
The people at godaddy told me that the only information I needed was the relayServer host name which is relay-hosting.secureserver and username and password weren't required.
感谢您的帮助。
推荐答案我觉得这是你的问题。从80端口更改邮件服务器端口到端口25在web.config
I think that is your problem. Change the mail server port from port 80 to port 25 in the web.config
尝试使用code的此块:
Try using this block of code:
Dim objMailMessage As New System.Net.Mail.MailMessage With objMailMessage .IsBodyHtml = False .From = New MailAddress("fromaddress@youremailaccount") .To.Add("destinationaddress@whoever") .Subject = "Your Subject" .Body = "Body Text" End With Dim objSMTPClient As New System.Net.Mail.SmtpClient("relay-hosting.secureserver", 25) objSMTPClient.Credentials = CredentialCache.DefaultNetworkCredentials objSMTPClient.DeliveryMethod = SmtpDeliveryMethod.Network objSMTPClient.Send(objMailMessage)下面是线程和其他一些例子为好。它还听起来像有一个GoDaddy的设置地方,但我不记得不必在我结束改变任何东西。
Here is the thread and some other examples as well. It also sounds like there is a godaddy setting somewhere, but I don't remember having to change anything on my end.
forums.asp/t/939893.aspx
更多推荐
asp.net设置电子邮件
发布评论