Solved

SMTP deosn't deliver email message, SYSTEM.WEB.MAIL

Posted on 2006-10-26
5
242 Views
Last Modified: 2010-04-23
Hi experts, I tried to use System.Web.Mail.MailMessage to send a tests email in my VB.NET program. I built and run the program, no build errors, exceptions or whatsoever, everything seems to work fine, however the test email is not delivered at all. what are the possible causes? is there a resource that particularly discuss this topic?

Here is the basic configuration of my local SMTP server:
Anynomous access; In Relay Restriction, I granted access for "127.0.0.1";

Here is the exact code I used (except email):

            Dim mailMsg As New MailMessage
            mailMsg.From = "from@from.com"  
            mailMsg.To = "to@to.com"
            mailMsg.Subject = "test subject"
            mailMsg.Body = "test Body"

            mailMsg.BodyFormat = MailFormat.Text
            SmtpMail.SmtpServer = "127.0.0.1"
            SmtpMail.Send(mailMsg)            
0
Comment
Question by:caibeier
  • 3
  • 2
5 Comments
 

Author Comment

by:caibeier
ID: 17814104
While, I just found out that all the test emails I sent, they are currently reside in folder:

C:\Inetpub\mailroot\Queue

what happened, why the SMTP server queued them instead of sending them out?
0
 
LVL 11

Accepted Solution

by:
LordWabbit earned 500 total points
ID: 17814409
the smtp 'server' installed with iis is actually just a relay, you still have to configure the smtp virtual server to route your emails to a proper smtp server (like your isp's or even gmail) but to be honest you may as well just change your smptserver property to your isp's smtp server.  the only benifit from using your virtual server is that at least you can queue emails whilst the smtp server is down and check badmail for any emails which had a problem.  
0
 

Author Comment

by:caibeier
ID: 17814683
Hi LordWabbit, thank you very much for the info. Does it mean that the only way I can use local iis smpt server to send email is to relay it to a proper server? is it possible to configure my local smpt server to be the "proper" server? (I mean, a simple way, not hard complex way)

Thanks again!
0
 
LVL 11

Expert Comment

by:LordWabbit
ID: 17815661
nope i'm afraid not, it's a virtual passthrough server, it cannot send emails by itself, simply relay them onto a real smtp server.  there are several smtp servers floating around, i can't give you any names cos i've never needed to install and use one, some will probably be open source as well so no costs, but open source can be a two edged sword, i would suggest extensive research and testing before letting one loose in a production environment.  if you have access to an outlook server you can always point your smtp host at it (depending on the configuration of the outook server).  If the server supports telnet sending of email i wrote a dll to send mails via telnet as well as add attachments using mime encoding, shout if you need the source (but you need an outlook server which allows telnet).
0
 

Author Comment

by:caibeier
ID: 17815912
I think I'll just stick with using an external server, that's much easier. (O:

Again, thanks for your help!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now