Hello,
I am trying to send email from my web site. My code is on Godaddy.com web server.
Here is a piece of code form my registration page:
...
MailAddress mailFrom = newMailAddress("organizer@dotnet.itags.org.jn07.com", "ACS WebcastAdministrator");
MailAddress mailTo = newMailAddress(Email.Text.Trim(), FirstName.Text.Trim() + " " +LastName.Text.Trim());
MailMessage mailMessage = new MailMessage(mailFrom, mailTo);
mailMessage.Subject = Webcast.SelectedItem.Text;
mailMessage.Body = "Thank you for registering the " +Webcast.SelectedItem.Text + " webcast.\n\n" +
...
SmtpClient mailClient = new SmtpClient("localhost");
mailClient.UseDefaultCredentials = true;
mailClient.Send(mailMessage);
...
I also setup my web.config to match Godaddy.com requirements:
<system.net>
<mailSettings>
<smtp from="organizer@dotnet.itags.org.jn07.com">
<network host="smtpout.secureserver.net" password="mypwd" userName="organizer@dotnet.itags.org.mydomain.com" />
</smtp>
</mailSettings>
</system.net>
But it does not work. I have the below error:
Server Error in '/ACS_Webcast' Application.
Mailbox unavailable. The server response was: 5.7.1 Unable to relay for misc@dotnet.itags.org.215d.com
Description:Anunhandled exception occurred during the execution of the current webrequest. Please review the stack trace for more information about theerror 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 formisc@dotnet.itags.org.215d.com
Source Error:
The source code that generated this unhandled exception can only beshown when compiled in debug mode. To enable this, please follow one ofthe below steps, then request the URL:1. Add a "Debug=true" directive at the top of the file that generated the error. Example:
<%@dotnet.itags.org. Page Language="C#" Debug="true" %
or:
2) Add the following section to the configuration file of your application:
<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration
Note that this second technique will cause all files within a givenapplication to be compiled in debug mode. The first technique willcause only that particular file to be compiled in debug mode.
Important:Running applications in debug mode does incur a memory/performanceoverhead. You should make sure that an application has debuggingdisabled before deploying into production scenario.
Take the localhost out of your SMTPClient constructor and just leave it blank. You are telling the SMTPclient class to use your web server as the SMTP server and not what is configured in your web.config file.
Chris,
I removed the localhost and I got the error below.
Server Error in '/ACS_Webcast' Application.
Mailbox name not allowed. The server response was: Sorry, that domain isn't in my list of allowed rcpthosts.
Description:Anunhandled exception occurred during the execution of the current webrequest. Please review the stack trace for more information about theerror and where it originated in the code.Exception Details:System.Net.Mail.SmtpFailedRecipientException:Mailbox name not allowed. The server response was: Sorry, that domainisn't in my list of allowed rcpthosts.
Source Error:
The source code that generated this unhandled exception can only beshown when compiled in debug mode. To enable this, please follow one ofthe below steps, then request the URL:1. Add a "Debug=true" directive at the top of the file that generated the error. Example:
<%@. Page Language="C#" Debug="true" %
or:
2) Add the following section to the configuration file of your application:
<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration
Note that this second technique will cause all files within a givenapplication to be compiled in debug mode. The first technique willcause only that particular file to be compiled in debug mode.
Important:Running applications in debug mode does incur a memory/performanceoverhead. You should make sure that an application has debuggingdisabled before deploying into production scenario.
Hi,
This should be SMTP service issue:
jacthemanus:
Mailbox name not allowed. The server response was: Sorry, that domain isn't in my list of allowed rcpthosts.
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 name not allowed. The server response was: Sorry, that domain isn't in my list of allowed rcpthosts.
The error message means the recipient's SMTP service doesn't allow email from your domain. And according to this KB:
http://support.microsoft.com/kb/912163/en-us
This issue can occur when the Internet service provider (ISP) and the e-mail provider are two different entities. I noticed that there are two of the domain names used in your example: jn07.com, 215d.com. Are you sure those domain's DNS record is configured correctly. Those are used to identify your email server.
There are topics before in this forums show that incorrectly DNS record can cause similar issue. And you may need to contact your ISP to correct DNS record for your domain names.
Change your web config to this
<system.net>
<mailSettings>
<smtp>
<network host="relay-hosting.secureserver.net"/>
</smtp>
</mailSettings>
</system.net>
GoDaddy uses this for a relay.
I too have been having this problem with GoDaddy and NetworkSolutions using ASP.NET mail classes, and with the Membership classes. I found out that I could send mail to anyone in our domain but to no one outside our domain.
The answer to the problem is in the inbound port number. For a client like Outlook the port defaults to 25. If you are using hotmail or a dedicated service like Network Solutions, GoDaddy and others you must have them give you a port number for your SMTP service to reach.
Since the service requires authentication it will not be port 25.
As this seems to vary I won't pass along the numbers that I have as they mostlikely won't work for you. A phone call to them has usually worked.
Hope this will help.
Larry
0 comments:
Post a Comment