By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,426 Members | 1,689 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,426 IT Pros & Developers. It's quick & easy.

ASP.NET SMTP mail never received

P: n/a
Hi all,

I am trying to use the System.Net.Mail class for the first time, with
ASP.NET 2.0.

I setup everything according to
http://www.codeproject.com/aspnet/EasySMTP_package.asp, which gives me
a working environment for sending mails.

I am sure the code is correct, there are no errors and everything seems
to work fine. However, I never receive the email. I've done some
research before posting this, and I suspect it is never sent because I
use a totally random email for the Msg.From Attribute, which may be
wrong. I am under Windows XP, IIS 6.0, and I would like to know how am
I supposed to know what valid email can I put in the From ?? Is there a
way to add mail (forward only) addresses from which we can effectively
send emails, somewhere in IIS or anywhere else? How am I supposed to
know what email to use in the From, if I simply sent it from localhost
(no domain or anything, just my own computer)?

Any help on this would be much appreciated,
thanks in advance!

Nov 13 '06 #1
Share this Question
Share on Google+
11 Replies


P: n/a
A quick check would be to see if you're dropping your email messages at the
SMTP relay.

%systemdrive%\inetpub\mailroot\drop
%systemdrive%\inetpub\mailroot\badmail
%systemdrive%\inetpub\mailroot\queue

That'd help to narrow out if it's the code (if your message is being generated
and packaged OK) or the SMTP on your web server.

In the from field, it depends on your SMTP server. Our Exchange servers
are locked down and require you to have the same domain, so we use donotreply@{
our domain here }.com or something similar. You should be able to use your
own email address.

If you're curious about your code, have you tried using breakpoints in your
code and stepping through to make sure it hits each step?

-dl

---
David Longnecker
Web Developer
http://blog.tiredstudent.com
Hi all,

I am trying to use the System.Net.Mail class for the first time, with
ASP.NET 2.0.

I setup everything according to
http://www.codeproject.com/aspnet/EasySMTP_package.asp, which gives me
a working environment for sending mails.

I am sure the code is correct, there are no errors and everything
seems to work fine. However, I never receive the email. I've done some
research before posting this, and I suspect it is never sent because I
use a totally random email for the Msg.From Attribute, which may be
wrong. I am under Windows XP, IIS 6.0, and I would like to know how am
I supposed to know what valid email can I put in the From ?? Is there
a way to add mail (forward only) addresses from which we can
effectively send emails, somewhere in IIS or anywhere else? How am I
supposed to know what email to use in the From, if I simply sent it
from localhost (no domain or anything, just my own computer)?

Any help on this would be much appreciated,
thanks in advance!

Nov 13 '06 #2

P: n/a
Thanks for quick reply :)

I've checked in all subfolders in %systemdrive%\inetpub\mailroot,
nothing there. Also, I've enabled tracing in IIS, to see if it would
give some hints, here's what it has generated when sending mail :
23:01:24 192.168.0.100 EHLO - 250
23:01:24 192.168.0.100 MAIL - 250
23:01:24 192.168.0.100 RCPT - 550
23:01:24 192.168.0.100 QUIT - 0

I haven't a clue of what that means...

For the From field, I am really no expert in terms of domains and all,
so that's why I suspect the problem is there...you say you use your
domain, but what's mine if I simply want to send an email from a
localhost IIS server, not attached to any domain? I tried to send from
my email, as you said, (which is a gmail.com address), and it still
doesn't send..

I stepped into my code line by line (it isn't that long), and
everything is executed normally, even the
MailObj.Send(Msg)

So, I really think it that 'domain' problem :\

thanks again!

David Longnecker wrote:
A quick check would be to see if you're dropping your email messages at the
SMTP relay.

%systemdrive%\inetpub\mailroot\drop
%systemdrive%\inetpub\mailroot\badmail
%systemdrive%\inetpub\mailroot\queue

That'd help to narrow out if it's the code (if your message is being generated
and packaged OK) or the SMTP on your web server.

In the from field, it depends on your SMTP server. Our Exchange servers
are locked down and require you to have the same domain, so we use donotreply@{
our domain here }.com or something similar. You should be able to use your
own email address.

If you're curious about your code, have you tried using breakpoints in your
code and stepping through to make sure it hits each step?

-dl

---
David Longnecker
Web Developer
http://blog.tiredstudent.com
Hi all,

I am trying to use the System.Net.Mail class for the first time, with
ASP.NET 2.0.

I setup everything according to
http://www.codeproject.com/aspnet/EasySMTP_package.asp, which gives me
a working environment for sending mails.

I am sure the code is correct, there are no errors and everything
seems to work fine. However, I never receive the email. I've done some
research before posting this, and I suspect it is never sent because I
use a totally random email for the Msg.From Attribute, which may be
wrong. I am under Windows XP, IIS 6.0, and I would like to know how am
I supposed to know what valid email can I put in the From ?? Is there
a way to add mail (forward only) addresses from which we can
effectively send emails, somewhere in IIS or anywhere else? How am I
supposed to know what email to use in the From, if I simply sent it
from localhost (no domain or anything, just my own computer)?

Any help on this would be much appreciated,
thanks in advance!
Nov 13 '06 #3

P: n/a
In addition to the previous post

(inetpub/mail stuff)

you also want to make sure you specifying the correct "authentication".

Check this post:
2/8/2006
Smarter Email/Smtp setup with DotNet Configuration Sections (1.1 and 2.0)
http://sholliday.spaces.live.com/blog/
Try different email (recipient) combo's , because sometimes something like
hotmail will block an incoming email. That's probably not the issue, but I
mention it anyways.


"ibiza" <la******@gmail.comwrote in message
news:11*********************@b28g2000cwb.googlegro ups.com...
Hi all,

I am trying to use the System.Net.Mail class for the first time, with
ASP.NET 2.0.

I setup everything according to
http://www.codeproject.com/aspnet/EasySMTP_package.asp, which gives me
a working environment for sending mails.

I am sure the code is correct, there are no errors and everything seems
to work fine. However, I never receive the email. I've done some
research before posting this, and I suspect it is never sent because I
use a totally random email for the Msg.From Attribute, which may be
wrong. I am under Windows XP, IIS 6.0, and I would like to know how am
I supposed to know what valid email can I put in the From ?? Is there a
way to add mail (forward only) addresses from which we can effectively
send emails, somewhere in IIS or anywhere else? How am I supposed to
know what email to use in the From, if I simply sent it from localhost
(no domain or anything, just my own computer)?

Any help on this would be much appreciated,
thanks in advance!

Nov 13 '06 #4

P: n/a
well, all setup in IIS should be fine.

Do you mean 'anonymous' as authentication (in IIS)?
sloan wrote:
In addition to the previous post

(inetpub/mail stuff)

you also want to make sure you specifying the correct "authentication".

Check this post:
2/8/2006
Smarter Email/Smtp setup with DotNet Configuration Sections (1.1 and 2.0)
http://sholliday.spaces.live.com/blog/
Try different email (recipient) combo's , because sometimes something like
hotmail will block an incoming email. That's probably not the issue, but I
mention it anyways.


"ibiza" <la******@gmail.comwrote in message
news:11*********************@b28g2000cwb.googlegro ups.com...
Hi all,

I am trying to use the System.Net.Mail class for the first time, with
ASP.NET 2.0.

I setup everything according to
http://www.codeproject.com/aspnet/EasySMTP_package.asp, which gives me
a working environment for sending mails.

I am sure the code is correct, there are no errors and everything seems
to work fine. However, I never receive the email. I've done some
research before posting this, and I suspect it is never sent because I
use a totally random email for the Msg.From Attribute, which may be
wrong. I am under Windows XP, IIS 6.0, and I would like to know how am
I supposed to know what valid email can I put in the From ?? Is there a
way to add mail (forward only) addresses from which we can effectively
send emails, somewhere in IIS or anywhere else? How am I supposed to
know what email to use in the From, if I simply sent it from localhost
(no domain or anything, just my own computer)?

Any help on this would be much appreciated,
thanks in advance!
Nov 13 '06 #5

P: n/a
No, the end smtp server sometimes need authentication.

Read the blog... will show more.
sometimes, like with dialup, you use "none" authentication.

sometimes , they want you to at least pass them your account id, and a
password.
(basic)

sometimes, they want a password, username and to use SSL (ssl
authentication)

It mimicks all the smtp settings you'd find under Outlook Express ...


"ibiza" <la******@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
well, all setup in IIS should be fine.

Do you mean 'anonymous' as authentication (in IIS)?
sloan wrote:
In addition to the previous post

(inetpub/mail stuff)

you also want to make sure you specifying the correct "authentication".

Check this post:
2/8/2006
Smarter Email/Smtp setup with DotNet Configuration Sections (1.1 and
2.0)
http://sholliday.spaces.live.com/blog/
Try different email (recipient) combo's , because sometimes something
like
hotmail will block an incoming email. That's probably not the issue,
but I
mention it anyways.


"ibiza" <la******@gmail.comwrote in message
news:11*********************@b28g2000cwb.googlegro ups.com...
Hi all,
>
I am trying to use the System.Net.Mail class for the first time, with
ASP.NET 2.0.
>
I setup everything according to
http://www.codeproject.com/aspnet/EasySMTP_package.asp, which gives me
a working environment for sending mails.
>
I am sure the code is correct, there are no errors and everything
seems
to work fine. However, I never receive the email. I've done some
research before posting this, and I suspect it is never sent because I
use a totally random email for the Msg.From Attribute, which may be
wrong. I am under Windows XP, IIS 6.0, and I would like to know how am
I supposed to know what valid email can I put in the From ?? Is there
a
way to add mail (forward only) addresses from which we can effectively
send emails, somewhere in IIS or anywhere else? How am I supposed to
know what email to use in the From, if I simply sent it from localhost
(no domain or anything, just my own computer)?
>
Any help on this would be much appreciated,
thanks in advance!
>

Nov 14 '06 #6

P: n/a
I made it to put the message in the
%systemdrive%\inetpub\mailroot\queue folder, but now, I can't tell it
is still in queue...I made the change to the Msg.To field ->
'donotreply@ibiza'
where ibiza is my domain name (computer name)

Any ideas why it's stocked in queue now?

sloan wrote:
No, the end smtp server sometimes need authentication.

Read the blog... will show more.
sometimes, like with dialup, you use "none" authentication.

sometimes , they want you to at least pass them your account id, and a
password.
(basic)

sometimes, they want a password, username and to use SSL (ssl
authentication)

It mimicks all the smtp settings you'd find under Outlook Express ...


"ibiza" <la******@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
well, all setup in IIS should be fine.

Do you mean 'anonymous' as authentication (in IIS)?
sloan wrote:
In addition to the previous post
>
(inetpub/mail stuff)
>
you also want to make sure you specifying the correct "authentication".
>
Check this post:
2/8/2006
Smarter Email/Smtp setup with DotNet Configuration Sections (1.1 and
2.0)
http://sholliday.spaces.live.com/blog/
>
>
Try different email (recipient) combo's , because sometimes something
like
hotmail will block an incoming email. That's probably not the issue,
but I
mention it anyways.
>
>
>
>
"ibiza" <la******@gmail.comwrote in message
news:11*********************@b28g2000cwb.googlegro ups.com...
Hi all,

I am trying to use the System.Net.Mail class for the first time, with
ASP.NET 2.0.

I setup everything according to
http://www.codeproject.com/aspnet/EasySMTP_package.asp, which gives me
a working environment for sending mails.

I am sure the code is correct, there are no errors and everything
seems
to work fine. However, I never receive the email. I've done some
research before posting this, and I suspect it is never sent because I
use a totally random email for the Msg.From Attribute, which may be
wrong. I am under Windows XP, IIS 6.0, and I would like to know how am
I supposed to know what valid email can I put in the From ?? Is there
a
way to add mail (forward only) addresses from which we can effectively
send emails, somewhere in IIS or anywhere else? How am I supposed to
know what email to use in the From, if I simply sent it from localhost
(no domain or anything, just my own computer)?

Any help on this would be much appreciated,
thanks in advance!
Nov 14 '06 #7

P: n/a
re:
is still in queue...I made the change to the Msg.To field ->
'donotreply@ibiza'
where ibiza is my domain name (computer name)
How do you expect a message to be delivered if it doesn't have a valid "To" address ?

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"ibiza" <la******@gmail.comwrote in message
news:11**********************@h54g2000cwb.googlegr oups.com...
>I made it to put the message in the
%systemdrive%\inetpub\mailroot\queue folder, but now, I can't tell it
is still in queue...I made the change to the Msg.To field ->
'donotreply@ibiza'
where ibiza is my domain name (computer name)

Any ideas why it's stocked in queue now?
sloan wrote:
>No, the end smtp server sometimes need authentication.

Read the blog... will show more.
sometimes, like with dialup, you use "none" authentication.

sometimes , they want you to at least pass them your account id, and a
password.
(basic)

sometimes, they want a password, username and to use SSL (ssl
authentication)

It mimicks all the smtp settings you'd find under Outlook Express ...


"ibiza" <la******@gmail.comwrote in message
news:11**********************@m73g2000cwd.googleg roups.com...
well, all setup in IIS should be fine.

Do you mean 'anonymous' as authentication (in IIS)?
sloan wrote:
In addition to the previous post

(inetpub/mail stuff)

you also want to make sure you specifying the correct "authentication".

Check this post:
2/8/2006
Smarter Email/Smtp setup with DotNet Configuration Sections (1.1 and
2.0)
http://sholliday.spaces.live.com/blog/
Try different email (recipient) combo's , because sometimes something
like
hotmail will block an incoming email. That's probably not the issue,
but I
mention it anyways.


"ibiza" <la******@gmail.comwrote in message
news:11*********************@b28g2000cwb.googlegro ups.com...
Hi all,

I am trying to use the System.Net.Mail class for the first time, with
ASP.NET 2.0.

I setup everything according to
http://www.codeproject.com/aspnet/EasySMTP_package.asp, which gives me
a working environment for sending mails.

I am sure the code is correct, there are no errors and everything
seems
to work fine. However, I never receive the email. I've done some
research before posting this, and I suspect it is never sent because I
use a totally random email for the Msg.From Attribute, which may be
wrong. I am under Windows XP, IIS 6.0, and I would like to know how am
I supposed to know what valid email can I put in the From ?? Is there
a
way to add mail (forward only) addresses from which we can effectively
send emails, somewhere in IIS or anywhere else? How am I supposed to
know what email to use in the From, if I simply sent it from localhost
(no domain or anything, just my own computer)?

Any help on this would be much appreciated,
thanks in advance!


Nov 14 '06 #8

P: n/a
"ibiza" <la******@gmail.comwrote in message
news:11**********************@h54g2000cwb.googlegr oups.com...
'donotreply@ibiza'
where ibiza is my domain name (computer name)

Any ideas why it's stocked in queue now?
Because that's an invalid email address...
Nov 14 '06 #9

P: n/a
well that's exactly what I want to know. How do I add valid emails to
my smtp server (setuped in IIS?), so I can send emails from those
emails.
Mark Rae wrote:
"ibiza" <la******@gmail.comwrote in message
news:11**********************@h54g2000cwb.googlegr oups.com...
'donotreply@ibiza'
where ibiza is my domain name (computer name)

Any ideas why it's stocked in queue now?

Because that's an invalid email address...
Nov 14 '06 #10

P: n/a
Set the "From" field to a valid email address.

static void PlainText()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("yo*@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);
}

You won't be able to *receive* mails as replies to the emails you send,
unless you have a POP3 server which can receive mail sent to the "From"
email addresses you include in your emails, though.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"ibiza" <la******@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
well that's exactly what I want to know. How do I add valid emails to
my smtp server (setuped in IIS?), so I can send emails from those
emails.
Mark Rae wrote:
>"ibiza" <la******@gmail.comwrote in message
news:11**********************@h54g2000cwb.googleg roups.com...
'donotreply@ibiza'
where ibiza is my domain name (computer name)

Any ideas why it's stocked in queue now?

Because that's an invalid email address...

Nov 14 '06 #11

P: n/a
RCPT 550 is typically caused because the remote mail was rejected or the
address was unapproved or unfound by that domain. More information about
SMTP can be found at http://www.ietf.org/rfc/rfc2821.txt, though that gets
a bit off topic for this group.

I'm assuming you're using, as in the example, the built-in SMTP of IIS 6.0?
When you set that up, what relay did you set that to? Your ISP? From experience,
my ISP, Cox Communications, doesn't allow non *@cox.net addresses to be sent
from their SMTP servers.

If you can step through and the .Send method works in your code, I'd bet
your code is fine and it lies somewhere in your SMTP configuration.

-dl

---
David Longnecker
Web Developer
http://blog.tiredstudent.com
Thanks for quick reply :)

I've checked in all subfolders in %systemdrive%\inetpub\mailroot,
nothing there. Also, I've enabled tracing in IIS, to see if it would
give some hints, here's what it has generated when sending mail :
23:01:24 192.168.0.100 EHLO - 250
23:01:24 192.168.0.100 MAIL - 250
23:01:24 192.168.0.100 RCPT - 550
23:01:24 192.168.0.100 QUIT - 0
I haven't a clue of what that means...

For the From field, I am really no expert in terms of domains and all,
so that's why I suspect the problem is there...you say you use your
domain, but what's mine if I simply want to send an email from a
localhost IIS server, not attached to any domain? I tried to send from
my email, as you said, (which is a gmail.com address), and it still
doesn't send..

I stepped into my code line by line (it isn't that long), and
everything is executed normally, even the
MailObj.Send(Msg)
So, I really think it that 'domain' problem :\

thanks again!

David Longnecker wrote:
>A quick check would be to see if you're dropping your email messages
at the SMTP relay.

%systemdrive%\inetpub\mailroot\drop
%systemdrive%\inetpub\mailroot\badmail
%systemdrive%\inetpub\mailroot\queue
That'd help to narrow out if it's the code (if your message is being
generated and packaged OK) or the SMTP on your web server.

In the from field, it depends on your SMTP server. Our Exchange
servers
are locked down and require you to have the same domain, so we use
donotreply@{
our domain here }.com or something similar. You should be able to
use your
own email address.
If you're curious about your code, have you tried using breakpoints
in your code and stepping through to make sure it hits each step?

-dl

---
David Longnecker
Web Developer
http://blog.tiredstudent.com
>>Hi all,

I am trying to use the System.Net.Mail class for the first time,
with ASP.NET 2.0.

I setup everything according to
http://www.codeproject.com/aspnet/EasySMTP_package.asp, which gives
me a working environment for sending mails.

I am sure the code is correct, there are no errors and everything
seems to work fine. However, I never receive the email. I've done
some research before posting this, and I suspect it is never sent
because I use a totally random email for the Msg.From Attribute,
which may be wrong. I am under Windows XP, IIS 6.0, and I would like
to know how am I supposed to know what valid email can I put in the
From ?? Is there a way to add mail (forward only) addresses from
which we can effectively send emails, somewhere in IIS or anywhere
else? How am I supposed to know what email to use in the From, if I
simply sent it from localhost (no domain or anything, just my own
computer)?

Any help on this would be much appreciated,
thanks in advance!

Nov 14 '06 #12

This discussion thread is closed

Replies have been disabled for this discussion.