Mailbox unavailable. The server response was: 5.7.1 Unable to relay for unixpeter@hotmail.com
Description:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: 5.7.1 Unable to relay for unixpeter@hotmail.com
Source Error:
Line 26: k.Host = "192.168.4.35"
Line 27: k.Timeout = 99999
Line 28: k.Send(s)
Line 29: k.Port = 25
Line 30: s.Dispose()
End Sub
Sub ExecuteSend(ByVal Sender As System.Object, ByVal E As System.EventArgs)
Dim a As New System.Net.Mail.MailAddress("unixpeter@hotmail.com")
Dim a2 As New System.Net.Mail.MailAddress("huibaichuan@hotmail.com")
Dim s As New System.Net.Mail.MailMessage(a2, a)
s.Subject = "title"
s.Body = "asdf"
s.BodyEncoding = ASCIIEncoding.GetEncoding("gb2312")
s.IsBodyHtml = True
Dim k As New System.Net.Mail.SmtpClient
k.Host = "192.168.4.35"
k.Timeout = 99999
k.Send(s)
k.Port = 25
s.Dispose()
End Sub
</script>
<html><head>
<title >Microsoft.net mail test</title>
</head>
<body text ="white" bgcolor="navy" >
<form runat ="server" id ="sbs">
<asp:Button ID ="sms" Text =" Send " OnClick ="ExecuteSend" runat ="server" /></td></tr>
</table>
use you tell me method on settings before,it's no problem,but i open my emailbox,not found mailMessage?please why?
not found any message in my mailBox?
This all (your top 3 threads). After you enable relaying on the mail server (or IIS) let me know if you get any more exceptions when sending the email.
unixpeter
Member
150 Points
30 Posts
Mailbox unavailable. The server response was: 5.7.1 Unable to relay for unixpeter@hotmail.com
Feb 24, 2006 02:32 PM|LINK
Server Error in '/' Application.
Mailbox unavailable. The server response was: 5.7.1 Unable to relay for unixpeter@hotmail.com
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: 5.7.1 Unable to relay for unixpeter@hotmail.com
Source Error:
Source File: e:\WebSite\Default.aspx Line: 28
Stack Trace:
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
my email address is no problem,and i try more true address,have the same problem.
please friends,thanks.
my source code
<%@Page Language="VB" ValidateRequest ="false" Debug ="true" EnableViewState ="true" EnableEventValidation ="true" EnableViewStateMac ="true" %>
<%@ Import Namespace ="System" %>
<%@ Import Namespace ="System.net" %>
<%@ Import Namespace ="System.net.mail" %>
<script runat="server">
Private Sub Page_Init()
Response.Expires = -1
Response.CacheControl = "no-cache"
End Sub
Private Sub Page_Load()
End Sub
Sub ExecuteSend(ByVal Sender As System.Object, ByVal E As System.EventArgs)
Dim a As New System.Net.Mail.MailAddress("unixpeter@hotmail.com")
Dim a2 As New System.Net.Mail.MailAddress("huibaichuan@hotmail.com")
Dim s As New System.Net.Mail.MailMessage(a2, a)
s.Subject = "title"
s.Body = "asdf"
s.SubjectEncoding = ASCIIEncoding.GetEncoding("gb2312")
s.BodyEncoding = ASCIIEncoding.GetEncoding("gb2312")
s.IsBodyHtml = True
Dim k As New System.Net.Mail.SmtpClient
k.Host = "192.168.4.35"
k.Timeout = 99999
k.Send(s)
k.Port = 25
s.Dispose()
End Sub
</script>
<html><head>
<title >Microsoft.net mail test</title>
</head>
<body text ="white" bgcolor="navy" >
<form runat ="server" id ="sbs">
<asp:Button ID ="sms" Text =" Send " OnClick ="ExecuteSend" runat ="server" /></td></tr>
</table>
</form>
</body></html>
StrongTypes
All-Star
30801 Points
6013 Posts
ASPInsiders
Re: Mailbox unavailable. The server response was: 5.7.1 Unable to relay for unixpeter@hotmail.com
Feb 24, 2006 07:19 PM|LINK
It looks like you don't have relaying enabled on the mail server. Once you enable relaying, it should send the message.
HTH,
Ryan
unixpeter
Member
150 Points
30 Posts
Re: Mailbox unavailable. The server response was: 5.7.1 Unable to relay for unixpeter@hotmail.com
Feb 25, 2006 12:36 AM|LINK
how to enabled?
what to enabled?
my localtion mail test server.
smtp +iis 5.0+.net2.0,why not allow relay?need username and password?
please
StrongTypes
All-Star
30801 Points
6013 Posts
ASPInsiders
Re: Mailbox unavailable. The server response was: 5.7.1 Unable to relay for unixpeter@hotmail.com
Feb 25, 2006 12:56 AM|LINK
If you want to enable relay on the web server do the following:
IIS > Default SMTP Server > Properties > Access > Authentication
Access Control > Anonymous access - Checked
Relay restrictions > Relay > - Only the list below (add the LAN IP address of the web server)
If you want to enable it on your mail server then you will need to find out how to do that as it varies depending on what mail server you are running.
HTH,
Ryan
unixpeter
Member
150 Points
30 Posts
Re: Mailbox unavailable. The server response was: 5.7.1 Unable to relay for unixpeter@hotmail.com
Feb 25, 2006 02:43 AM|LINK
t hanks for you,and i'll try it.
i don't konw how to settings for SMTP Server,and my test server on location computer.
StrongTypes
All-Star
30801 Points
6013 Posts
ASPInsiders
Re: Mailbox unavailable. The server response was: 5.7.1 Unable to relay for unixpeter@hotmail.com
Feb 25, 2006 02:58 AM|LINK
Are you referring to setting the SMTP server / login in your code for sending the message or on your server?
unixpeter
Member
150 Points
30 Posts
Re: Mailbox unavailable. The server response was: 5.7.1 Unable to relay for unixpeter@hotmail.com
Feb 25, 2006 07:50 AM|LINK
i readlly setting all user allow access mail server,(checked),but problem the same.
unixpeter
Member
150 Points
30 Posts
Re: Mailbox unavailable. The server response was: 5.7.1 Unable to relay for unixpeter@hotmail.com
Feb 25, 2006 07:53 AM|LINK
need mail sender username and password,and must logon to my email corporation?
unixpeter
Member
150 Points
30 Posts
Re: Mailbox unavailable. The server response was: 5.7.1 Unable to relay for unixpeter@hotmail.com
Feb 25, 2006 12:56 PM|LINK
use you tell me method on settings before,it's no problem,but i open my emailbox,not found mailMessage?please why?
not found any message in my mailBox?
StrongTypes
All-Star
30801 Points
6013 Posts
ASPInsiders
Re: Mailbox unavailable. The server response was: 5.7.1 Unable to relay for unixpeter@hotmail.com
Feb 25, 2006 05:54 PM|LINK
use you tell me method on settings before,it's no problem,but i open my emailbox,not found mailMessage?please why?
not found any message in my mailBox?
This all (your top 3 threads). After you enable relaying on the mail server (or IIS) let me know if you get any more exceptions when sending the email.
HTH,
Ryan