Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Message won't send

Status
Not open for further replies.

JunglesMcBeef

Programmer
Sep 18, 2003
266
Hi,

I'm trying to send an email through SMTP. I had it all working but for some reason it has stopped working after making minor changes I thought wouldn't change a thing. Anyway here's my current code:
Code:
strMsg = "PO Number: " & oReceival.PONumber & _
  vbCrLf & "Item Code: " & oReceival.ItemCode

With oMail
.To = "tgale@provimi.com.au"
.From = "idministrator@hotmail.com"
.Subject = "Receival #" & oReceival.ReceivalNo
.Body = strMsg
.BodyFormat = Mail.MailFormat.Text
End With

System.Web.Mail.SmtpMail.SmtpServer = "127.0.0.1"
System.Web.Mail.SmtpMail.Send(oMail)

Can you see anything wrong with this? It doesn't return any error messages, it continues processing, but the email disappears in the process. I'll keep slugging away in the meantime. Thanks
 
I only made minor changes to the strings that make up the From and To properties. I did get a couple of delivery failure notifications for a couple of emails, but that was random and hasn't occurred since. I have tried a different SMTP server, still sends the email but the mail never shows up. I have tried different senders and recipients. The thing that baffles me is that there is usually no confirmation of the delivery or failure of the email.... What is going on?
 
are the mails being sent internally??? to your mail server? or are they going out?

if they are internal, what software are you using(ie - ms exchange server, mdaemon, etc)

if they are going out, have you tried multiple to recipients? like send it to a hotmail, gmail, yahoo account? and use cc's to see if it is dying anywhere?

(i had this problem with vbscript a few months back - mail sent GREAT and then suddenly stopped. you need to try and determine if the mail is dying at the recipients server, or if it is even being sent at all. plus, try an alias from or a real from address just to verify).

another thing, most email servers have features to block incoming spam. what they can do is say, you cannot send mail from account X until you have checked mail, and vice versa. so try different combinations of addresses if you think that is where the fault lies.

let me know what happens
 
Ok I got onto a tool - SmtpDiag.exe, and my mail is sending now. Highly recommended for anyone with an SMTP problem on Win2K.

What I found was that I had to find a server that could resolve the domain of the address. Using a local server wouldn't work (with either hotmail or our private domain addresses), but I tried a server that we used to use for our external mail because I thought they may have our particular alias address info (even though this wasn't the real problem) and it worked. Thanks anyway
 
jungles

you can also try to create a virtual smtp server in iis on win2k server or 2k3 server. check out msdn to see how to set it up properly (most of the settings are left blank). but that can do it also.

hayt
 
That was what wasn't working (it is what I meant by - " Using a local server wouldn't work (with either hotmail or our private domain addresses)"). I tried that and it couldn't resolve the domains of the email addresses. Yes it would be good if that feature worked, but I couldn't get it working. So until the ISP that I am using goes down I'll keep making use of it :) Cheers
 
sorry that i couldn't help. it's good that you got it working. I've had so many problems in the past with that stuff. i eventually had to point my virtual smtp server toward my real mail server, because my real mail server wouldn't accept the program's emails. weird stuff. but it worked for me. iis is realy very powerful, unfortunately, the documentation for it is fairly horrid. good luck in the future. here's to your isp staying alive.


hayt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top