This may ultimately be an SMTP admin question (as opposed to VB.Net) but, I wrote the following code to send a mail messge from a VB.Net app.
Dim from As String = "dexterm@mindspring.com"
Dim mailto As String = "dexterm@mindspring.com"
Dim subject As String = "Test Message"
Dim body As String = "Can you see this"
SmtpMail.SmtpServer = "localhost"
SmtpMail.Send(from, mailto, subject, body)
I don't know a lot about SMTP but it appears to be working; at least, I don't get any error messages inside the try/catch. I looked at the SMTP mail queue "C:\inetpub\mailroot\Queue" and all of the messages appear to be "stuck" there.
1st question - why aren't the messages getting sent Is there some option I need to check in IIS or SMTP
2nd question - Is SMTP the protocol that Microsoft Outlook and other mail apps use If I were to distribute this app, I can't assume that the user has SMTP can I
Thanks in advance for your help
Dexter McCloud

Sending mail with VB.Net
marklar
Guillermo Roldán
I don't see how this is conflicting with what I suggested. That is, you need a mail server. In my case, since I'm working offline, I have to connect. If you're running connected, it will just see the mail in the queue and send it. But in any case, you have to have a mail server to process the mail. The SMTP service doesn't actually perform any routing, as far as I know, and that was my point.
Jose Ann Roche
I don't have IIS in front of me so I don't remember the exact location of where it is in SMTP, but just go into the properties and make sure you have the host set to a "real" mail server that accepts anonymous (or authenticated if this is for your company or something) SMTP messages. Your code is fine and works, it's just your configuration sounds a little whacked.
Good luck!
Lovie
Here's what the problem was - there is an option in SMTP properties called "Smart Host". Here you are suposed to specify the name of your ISP's SMTP server; otherwise, it will get stopped at the gate. On top of that, in my software, I was explicitly specifying the name of my SMTP server as "localhost". Using SMTPMail, if you DON'T specify the SMTP server, it will find the default SMTP server.
Once I got those two issues resolved, I was able to send mail from my VB.Net app.
Thanks for your help
johnninan
Squig
Scott Gunn
Christopher Lusardi
brrrr
I was just saying that I think the problem in dexterm's case, is that nothing is setup to "pick it up" and send it from SMTP in IIS.
halola
Vishal Mistry
well as far as connecting to Exchange, I ran my app both with Outlook running and offline. I can "see" that my code is working because the message goes into C:\inetpub\mailroot\Queue. However, it nevers gets OUT of the queue (i.e. actually getting mailed to the recipient).
I downloaded a free SMTP component by SoftArtisans and compiled their VB sample. Amazingly enough, I had written my code in the exact same manner. Running their code ended up with the same results.
I then stopped and restared the SMTP Service in the hope that it would search the queue at startup and try to "catch up". However, to no avail...
So, obviously it's my configuration but I have no idea where to look :-(