asp.net设置电子邮件

编程入门 行业动态 更新时间:2024-10-22 07:16:01
本文介绍了asp设置电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

唉,我的经验已经到头并请求帮助。到目前为止,我已经跟着从这篇文章 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设置电子邮件

本文发布于:2023-11-16 09:53:35,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1603220.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:电子邮件   asp   net

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!