473,408 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

ASP.NET SMTP mail never received

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
11 2677
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
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
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
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
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
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
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
"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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: michi | last post by:
Hello :) When I execute following asp.net code **** Web.Mail.SmtpMail.SmtpServer = "squadron" Web.Mail.SmtpMail.Send("wwwmike@gmx.ch", "wwwmike@gmx.ch", "subj", "message") ****
1
by: michi | last post by:
Hi there.... Got here a tricky thing with my SMTP. First I show you what works on my machine.. **This Works** SmtpMail.SmtpServer = "mail.gmx.net" <-gmx is my mail provider...
17
by: Jesper Nielsen | last post by:
Hi all! I am currently planning an e-mail service. The base core of the service will simply be a MDaemon mail server with a modified WorldClient as the frontend. Unfortuneately, MDaemon cannot...
34
by: antonyliu2002 | last post by:
I've set up the virtual smtp server on my IIS 5.1 like so: 1. Assign IP address to "All Unassigned", and listen to port 25. 2. Access Connection granted to "127.0.0.1". 3. Relay only allow...
7
by: oopsbabies | last post by:
Hello everyone, I am using Apache 1.3.33 as the web server and PHP version 4.3.10. My machine is using Windows XP 2002 professional edition which comes with a Windows firewall. I am using McAfee...
1
by: kuratkull | last post by:
Ok, I wrote a Honeypot in perl. It listens on port 25 and acts as a crude SMTP server. It responds to the most basic commands(helo, mail from, rcpt to, data) needed for sending mail. It has no way...
0
by: ja99son | last post by:
I have a requirement to route mail bound for certain domains using a TLS connection. I have a mailsweeper box (which cannot use TLS) which is configured to route mail for those specific domains...
4
by: lage | last post by:
Hi, I am working with a web site that uses CDONTS from a function in a Com+ component to send mail to clients after sign up etc, as well as sending clients mail to support from a web form. A...
7
by: lilbit02 | last post by:
I'm trying to figure this out with out any Java experience. I'm trying to write a program that will send a SMTP email. I was given a shell and I do know how to establish a connection. My next...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.