Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
Not able to send email from godaddy server. Getting following error,
Mailbox name not allowed. The server response was: Sorry, that domain isn't in my list of allowed rcpthosts.
 
Here is my code snippet.
 
System.Net.Mail.SmtpClient Mail = new System.Net.Mail.SmtpClient();
 
        Mail.Host = "smtpout.secureserver.net";
        Mail.Port = 3535;
        Mail.Timeout = 10000;
        
        string username = null;
        string Password = null;
 

        Mail.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
        username = txtUsername.Text.Trim();
        Password = txtPassword.Text.Trim();
        System.Net.NetworkCredential basicAuthenticationInfo = new System.Net.NetworkCredential(username, Password);
 
        Mail.UseDefaultCredentials = false;
        Mail.Credentials = basicAuthenticationInfo;
 
        System.Net.Mail.MailMessage myMail = new System.Net.Mail.MailMessage();
        myMail.Subject = "Test Email";
 
        myMail.From = new System.Net.Mail.MailAddress(txtFrom.Text, txtFrom.Text);
        myMail.To.Add(new System.Net.Mail.MailAddress(txtTo.Text));
 

        myMail.IsBodyHtml = true;
        myMail.Body = "Test Email";
 

        try
        {
            Mail.Send(myMail);
            lblmsg.Text = "Message send successfully.";
        }
        catch (Exception ex)
        {
            lblmsg.Text = ex.Message.ToString();
        }
 
I have tried with port 25 and 3535 but same error is coming.
Posted 29-Mar-12 20:11pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

This is a server configuration, nothing a programmer can fix without access to the server. You're not allowed to relay through that server to the destination domain, and only the server admin can fix that for you.
 

Replace your code with this code And check weather it works fine or not.
I checked it and works fine from my side.
 


try
{
SmtpClient client = new SmtpClient("smtpout.secureserver.net", 3535);
System.Net.NetworkCredential myCache = new System.Net.NetworkCredential("complete email id", "password");
client.Credentials = myCache;
// Specify the message content.
MailMessage message = new MailMessage(pankaj@idjo.org, "pankaj@idjo.org");
message.Body ="test";
message.Subject ="test";
client.Send(message);
message.Dispose();
Console.WriteLine("Sent email to: " + "pankaj@idjo.org");
}
catch (Exception ex)
{
Console.WriteLine("{0} Exception caught.", ex);
}
  Permalink  
Comments
Mukund Thakker at 30-Mar-12 7:44am
   
This is what posted by Uday Singh. Please check my comments in Solution1
swapnilKumbhar at 2-Apr-12 11:56am
   
try this
1)check your connection setting once again
2)off the firewall then try
3)try to connect to other server
else show your code to expert.
 
hope you come out of this problem.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Try This[^]
 
hope it helps Smile | :)
  Permalink  
Comments
Mukund Thakker at 30-Mar-12 2:06am
   
I have already checked this, gives following error,
 
Mailbox name not allowed. The server response was: Sorry, that domain isn't in my list of allowed rcpthosts.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

SmtpClient ss = new SmtpClient();
               ss.Host = "relay-hosting.secureserver.net";
                ss.Port = 25;
                ss.Timeout = 10000;
                ss.DeliveryMethod = SmtpDeliveryMethod.Network;
                ss.UseDefaultCredentials = false;
                ss.Credentials = new NetworkCredential("your_full_emailAddress", "YourPassword", "your_Domain");
                ss.EnableSsl = false;
 
                MailMessage mailMsg = new MailMessage("your_full_emailAddress", "demo@gmail.com", "subject here", "my body");
                mailMsg.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
                ss.Send(mailMsg);
 
                Response.Write("Mail Sent");
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 565
1 Maciej Los 319
2 Richard MacCutchan 220
3 BillWoodruff 164
4 Mathew Soji 160
0 OriginalGriff 8,654
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,639
3 Maciej Los 5,229
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 20 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100