Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

Email problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dave - 31 Aug 2007 00:00 GMT
I have the following code to send an email and I get this error:
[SmtpFailedRecipientException: Mailbox unavailable. The server response was:
<someEmail@someHost.com> No such user here]. The error is on at last line
below.

SmtpClient smtpClient = new SmtpClient();
       MailMessage message = new MailMessage();

       MailAddress fromAddress = new MailAddress("myMail@anyHost.com",
                                              "POS-eTive Point of Sales.");
       // host name of server
       smtpClient.Host = "mail.someHost.com";

       //Default port will be 25
       smtpClient.Port = 25;

       //From address will be given as a MailAddress Object
        message.From = fromAddress;

       // To address collection of MailAddress
       message.To.Add(Email.Text);
       message.Subject = " auto responder notice.";

     
     
       // Message body content
       message.Body = "some message";

       // Send SMTP mail
       smtpClient.Send(message);

Signature

L. A. Jones

Bgreer5050 - 31 Aug 2007 03:21 GMT
Is the site hosted locally or remotely?  It seems you might need to
authenticate with a password for the smtp.

>I have the following code to send an email and I get this error:
> [SmtpFailedRecipientException: Mailbox unavailable. The server response
[quoted text clipped - 26 lines]
>        // Send SMTP mail
>        smtpClient.Send(message);
Michael Nemtsev, MVP - 31 Aug 2007 03:57 GMT
Hello Dave,

do u have the right credentials for the SMTP in your web.config?
because as  was noted this could lead u to that exception

---
WBR,
Michael  Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour 

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

D> I have the following code to send an email and I get this error:
D> [SmtpFailedRecipientException: Mailbox unavailable. The server
D> response was: <someEmail@someHost.com> No such user here]. The error
D> is on at last line below.
D>
D> SmtpClient smtpClient = new SmtpClient();
D> MailMessage message = new MailMessage();
D> MailAddress fromAddress = new
D> MailAddress("myMail@anyHost.com",
D> "POS-eTive Point of
D> Sales.");
D> // host name of server
D> smtpClient.Host = "mail.someHost.com";
D> //Default port will be 25
D> smtpClient.Port = 25;
D> //From address will be given as a MailAddress Object
D> message.From = fromAddress;
D> // To address collection of MailAddress
D> message.To.Add(Email.Text);
D> message.Subject = " auto responder notice.";
D> // Message body content
D> message.Body = "some message";
D> // Send SMTP mail
D> smtpClient.Send(message);
Andreas Kraus - 31 Aug 2007 09:16 GMT
> I have the following code to send an email and I get this error:
> [SmtpFailedRecipientException: Mailbox unavailable. The server response was:
> <someEmail@someHost.com> No such user here].

I assume the e-mail address you are trying to send to doesn't exist. Try
another one which exists for sure.

SmtpFailedRecipientException Class
Represents the exception that is thrown when the SmtpClient is not able to
complete a Send or SendAsync operation to a particular recipient.

hth,
Andreas
Signature

More on ASP.NET and Silverlight on my blog: <a
href="http://www.andreas-kraus.net/blog">Andreas Kraus on ASP.NET</a>


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.