Auto Ad Code

Wednesday, September 12, 2012

[SOLVED] Mailbox name not allowed. The server response was: sorry, your mail was administratively denied.

If your website is hosted at Godaddy.com then you may face this error while using SMTP.

Mailbox name not allowed. The server response was: sorry, your mail was administratively denied. (#5.7.1)

Whats the reason? And he solution.
the only reason of this error is that Godaddy only allows those email addresses in FROM clause which are from same domain.
Suppose your domain is mydomain.com then only those Mails will be sent which are having an Email address in their FROM clause which is from mydomain.com. Its not must that the email address should exist. You can use imaginary mail address like noreply@mydomain.com etc etc. The only restriction is that the email address should be of same domain.

Let us suppose your domain is mydomain.com
C#


MailMessage mMailMessage = new MailMessage(new MailAddress("noreply@mydomain.com", "No Reply"), new MailAddress("anybody@testdomain.com", "Test User"));
mMailMessage.Subject = "Email Subject";
string mEmailBody = "Email Body";
mMailMessage.Body = pEmailBody;
mMailMessage.IsBodyHtml = true;
SmtpClient mSMTPClient = new SmtpClient("relay-hosting.secureserver.net", 25);
mSMTPClient.Send(mMailMessage);
mMailMessage.Dispose();



VB.Net


Dim mMailMessage As MailMessage = New MailMessage(New MailAddress("noreply@mydomain.com", "No Reply"), New MailAddress("anybody@testdomain.com", "Test User"))
mMailMessage.Subject = "Email Subject"
Dim mEmailBody As String = "Email Body"
mMailMessage.Body = pEmailBody
mMailMessage.IsBodyHtml = True
Dim mSMTPClient As SmtpClient = New SmtpClient("relay-hosting.secureserver.net", 25)
mSMTPClient.Send(mMailMessage)
mMailMessage.Dispose()

No comments:

Post a Comment