|
Hi,
i wrote a small vb.net console application for sending emails to a gmail-account.
The application works fine on my developement-system ( wondows 10).
When i distribute the application to Windows server 2012 r2 the app did not send the email, the app termine without error but the email was not send.
i try allready to switch firewall off, but without success.
Anybody has a idea what can be wrong?
The code loke like this:
Imports System.IO
Imports System.Net.Mail
Imports System.Net
Sub Main()
Try
Dim loMessage As MailMessage = Nothing
Dim loClient As SmtpClient = Nothing
loClient = New SmtpClient()
loClient.Timeout = 50000
loClient.Host = "smtp.gmail.com"
loClient.Port = 587
loClient.EnableSsl = True
loClient.Credentials = New System.Net.NetworkCredential("test@gmail.com", "xxxxxxxxxx")
loMessage = New MailMessage()
loMessage.IsBodyHtml = True
loMessage.From = New MailAddress("xxxxxx@gmail.com")
loMessage.To.Add(New MailAddress("xxxxxx@bluewin.ch"))
loMessage.Subject = "Betreff"
loMessage.Body = "Test Ihre Daten..."
loClient.Send(loMessage)
Catch ex As Exception
Dim file As System.IO.StreamWriter
file = My.Computer.FileSystem.OpenTextFileWriter("c:\tmp\err.txt", True)
file.WriteLine(ex.ToString)
file.Close()
End Try
End Sub
|
|
|
|
|
Make sure that the server anti-virus isn't implementing "mass mailing protection". I've had that problem with McAfee Enterprise.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Thanks for the hint, but i did not use mc-affee and for testing i had disabled the installed anti-virus.
|
|
|
|
|
Thanks solved!!!
modified 9-May-16 8:02am.
|
|
|
|
|
Most likely because you spelled "debug" incorrectly, one 'g' not two.
However, it appears that you are trying to mix a Windows program with a console app, and you give no clue where this message appears from.
|
|
|
|
|
HI, I tried both in ConsoleApplication and in wpf...on another pc it WORKS on wpf application...I have on mine 2010 version...the same message appears on both applications...'c\....exe is missing. Looked over all google advices I could find, tried all but nth...in wpf it does not work on my pc either..but on another it does...???(code is copy/pasted)
|
|
|
|
|
Very interesting, but it tells us nothing. You need to explain exactly what happens, where the code fails and what results or messages you see, or expect but do not see.
|
|
|
|
|
I get the message that the .exe file does not exist. Otherwise, the code should create simple xaml file.
|
|
|
|
|
Member 12473290 wrote: the message that the .exe file does not exist. Then you know what to do.
|
|
|
|
|
Please, I am complete beginner, I looked all arround google to find the answer but no success. Is there a usefull link or sth? many thanks!!!
|
|
|
|
|
The shortcut you're clicking on doesn't go anywhere. It's pointing an .EXE file that isn't there!
|
|
|
|
|
I answered this question in the very first reply to you, which you have ignored. And we still have no real idea what your problem is, apart from the fact that 'something' cannot find your program. If you do not know where it is then how do you expect a bunch of strangers to know? We have no access to your system, so cannot see your screen, or search your hard drive.
|
|
|
|
|
In future, please do not remove the original problem; a forum like this works better if it remains because someone else might come across a similar issue but because you've removed it, they might miss that you had the same thing and would thus miss the solution.
|
|
|
|
|
How to connect and open firebird 3 database with vb
Net
yung
|
|
|
|
|
|
I trying that but still cannot open connection. Can u help me mr with sample source code for every body in codeproject. Tq u very much mr
yung
|
|
|
|
|
Please show what you have tried.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Tq u all, firebird 3 must be using embeded server type to connect with database
yung
|
|
|
|
|
How to secure web application not copy code
|
|
|
|
|
If you like to get a helpful answer you shouldn't use the subject line for the message body.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
|
Server-side code, or client-code?
The server-side code should not be viewable from the outside; the client code needs to be readable in order to execute.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
1. Please do not cross post.
2. You need to give a lot more detail to what you are asking.
3. If you build your code, then it is compiled. Anyone who has access to the server can copy it, but it is compiled so you shouldn't worry about it.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I was reading article on Garbage Collection. I have below queries-
1) There are many objects in my heap and stack and memory is getting low. How Garbage Collector will come to know which object to recollect?
2) Is there any property in object that tells GC that it can collect that object?
3) What is the need of three garbage collector generation? Where are these generations located(physical or logical)?
|
|
|
|
|
1. When the object goes out of scope, is disposed or otherwise has no references to it, it can be garbage collected.
2. The reference counter tells GC when it is ready to be swept up.
3. Not sure what that means.
|
|
|
|