if this works in a web app but not a winform app, one thing does come to mind - your anti virus software. Some do block sending emails from an application, others wait until the application is closed to send the email. I would also check to see if in your junk email inbox has those emails incase if it filters it out.
The way I did it in a WinForm app in .NET 2003 was simply to add a reference to System.Web then import the namespace. Secondly the code was like this:
Dim theMailMessage as new System.Web.Mail.MailMessage()
theMailMessage.Body = "hi"
Dim theSMTP as System.Web.Mail.SmtpMail()
theSMTP.Server = "IP.Address.Of.Server"
theSMTP.Send(theMailMessage)
of course its similar/same as yours. I wouldnt understand what could not cause it to get there. Its sending ok as you are saying but not recieving... bit of a puzzler. Again, I would disable your AV Software and send it, and check the junk email inbox too
|