smtp.send problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm having a problem using the System.Net.Mail.SmtpClient. After I set
everything up and issue the Send method it throws an exception indicating
"Sorry, that domain isn't in my list of allowed rcpthosts", which is
apparently coming from the mail server, smtpout.secureserver.net.

However, I do indeed have the email address set up properly (with GoDaddy)
and I have successully set up Outlook Express with the appropriate paremeters
so that I can send and recive emails for the email address through that
(Outlook express).
When I try to do it with System.Net.Mail.SmtpClient, and set up the
parameters the same as I set them up for Outlook Express, I get that "domain
isn't allowed" message.

Any ideas what I could be doing wrong?
 
Hi,

have your set the smtp user and password? You can set the credentials
by:

SmtpClient smtp = new SmtpClient(smtpServer, smtpPort);

smtp.Credentials = new NetworkCredential(login, password);

smtp.Send(message);

Santi
 
Yes, I've set the credentials. It does seem to be getting through to the
email processer server. The message I get seems to be indicating that it's
not letting me send the outgoing email to the particular email address domain
that I'm sending it to. But I also have set up Outlook Express (with all the
same paremeters) and that works just fine, both for receiving and sending
emails. So it's got me stumped as to why it doesn't work when using doing it
through my C# program.

- Roger
 
I figured out the problem.

The constructor for the System.Net.NetworkCredential includes UserName,
Password, and Domain as arguments. When I specify all three I get the error
message back from the email server. When I leave off the Domain portion it
works fine, sending my email through.

This would seem to be a goof on the part of the email server. Even if I were
somehow specifying the wrong domain, the error message they respond with is
"Sorry, that domain isn't in my list of allowed rcpthosts". But that is
usually an indication that the intended recipient of the email is not within
their list of valid recipients. It is NOt usually an indication that the
authentication failed.

So, it works no, after four hours of searching the Internet and
trial-and-error.
 
Back
Top