473,508 Members | 2,360 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Email problem

I have the following code to send an email and I get this error:
[SmtpFailedRecipientException: Mailbox unavailable. The server response was:
<so*******@someHost.comNo such user here]. The error is on at last line
below.

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

MailAddress fromAddress = new MailAddress("my****@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);

--
L. A. Jones
Aug 30 '07 #1
3 1460
Is the site hosted locally or remotely? It seems you might need to
authenticate with a password for the smtp.

"Dave" <Da**@discussions.microsoft.comwrote in message
news:09**********************************@microsof t.com...
>I have the following code to send an email and I get this error:
[SmtpFailedRecipientException: Mailbox unavailable. The server response
was:
<so*******@someHost.comNo such user here]. The error is on at last line
below.

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

MailAddress fromAddress = new MailAddress("my****@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);

--
L. A. Jones

Aug 31 '07 #2
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
DI have the following code to send an email and I get this error:
D[SmtpFailedRecipientException: Mailbox unavailable. The server
Dresponse was: <so*******@someHost.comNo such user here]. The error
Dis on at last line below.
D>
DSmtpClient smtpClient = new SmtpClient();
DMailMessage message = new MailMessage();
DMailAddress fromAddress = new
DMailAddress("my****@anyHost.com",
D"POS-eTive Point of
DSales.");
D// host name of server
DsmtpClient.Host = "mail.someHost.com";
D//Default port will be 25
DsmtpClient.Port = 25;
D//From address will be given as a MailAddress Object
Dmessage.From = fromAddress;
D// To address collection of MailAddress
Dmessage.To.Add(Email.Text);
Dmessage.Subject = " auto responder notice.";
D// Message body content
Dmessage.Body = "some message";
D// Send SMTP mail
DsmtpClient.Send(message);
Aug 31 '07 #3
"Dave" wrote:
I have the following code to send an email and I get this error:
[SmtpFailedRecipientException: Mailbox unavailable. The server response was:
<so*******@someHost.comNo 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
--
More on ASP.NET and Silverlight on my blog: <a
href="http://www.andreas-kraus.net/blog">Andreas Kraus on ASP.NET</a>

Aug 31 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1918
by: jpastora | last post by:
I'm having a strange problem with our email links on the domain : http://www.pc350.com/ . The problem is that when you click on an email link, the email app is not launched until the browser...
6
3444
by: mike | last post by:
I have created a side application in VB.NET which reads rows from a DB and builds an email message. when i have a long string the the mailmessage.body or the mailmessage, it puts in an...
88
12319
by: Mike | last post by:
Is there a way to determine what a user's default email client is? I read a post from 3 years ago that said no. I guess I'm hoping something has come along since then.
0
2133
by: VP | last post by:
g'day, i am posting a problem i have encountered with creating an email using outlook through some basic c# code. the problem arises when using different email editors in outlook. At the moment...
14
9105
by: supz | last post by:
Hi, I use the standard code given below to send an email from an ASP.NET web form. The code executes fine but no Email is sent. All emails get queued in the Inetpub mail queue. I'm using my...
26
2649
by: libsfan01 | last post by:
Hi all! Can anyone show me how to check and email field on a form for the existence of these two characters. Kind regards Marc
0
4209
by: RickVidallon | last post by:
Missing or Truncated Body Text in Email Application - 2 Strange Examples... There is no earthly reason why this is happening! EXAMPLES HERE: http://65.36.227.70/actmailer/ We have a...
3
3819
by: Steven Allport | last post by:
I am working on processing eml email message using the email module (python 2.5), on files exported from an Outlook PST file, to extract the composite parts of the email. In most instances this...
3
8914
by: IGD | last post by:
I don't know if this is the right place to post this or not. If not, could someone direct me elsewhere where I would find more information on how to solve my problem? Thanks! My problem is this:...
28
4393
tdw
by: tdw | last post by:
Hi all, I am trying to add a feature to our database that automates sending emails. When entering a new order, I want the option to send an email to the company the order came from, attaching a...
0
7115
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7321
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7489
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5624
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5047
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4705
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.