How Do You Send Emails if SMTP is Not Loaded on the Server? - vb.net

using the Code Snippet for sending email in VB.Net I have successfully sent an email from my local machine, but when I Upload it to my server I get a message that the email failed. We have a national relay server that is running SMTP and I am pointed at that server in both instances. The only differance that jump out at me between the two machines is that the server is not running SMTP. Do I need SMTP to be running on the server if I am using a relay server to send the email that is running SMTP?
Dim message As New MailMessage("DoNotReply#faa.gov", My.Settings.NotifyList, "Starting FalconCMSOffloader # " & My.Settings.FacID & " - " & Now, "NM")
Dim emailClient As New SmtpClient(My.Settings.EmailServerAddress)
emailClient.Send(message)

You shouldn't need SMTP running locally, as the VB.Net code should just be using basic TCP/IP to communicate directly to the relay server.
It would be useful to see the error message, it is possible that the server does not have access to port 25 on the relay server (eg. due to the firewall configuration). Note that you can test this connectivity to some degree by launching telnet from the command line (on the server) as follows:
telnet RelayServerAddress 25
There is also a chance that there is some authentication happening with the relay server when you run the code locally on your machine under your domain account that isn't able to happen when the code is running on the server under a local account (I'm making some big assumptions here).

You should not need an smtp server on the server if you specify the relay server. Double check that My.Settings.EmailServerAddress is indeed pointing to the relay server.

Related

VB.NET Server Does Not Receive Connection Requests from Remote Clients

VB.NET Server Does Not Receive Connection Requests from Remote Clients
A VB.NET server application does not see connection requests from another client on the network (i.e. with a different IP address). However, it does see connection requests from the client application running on the same computer as the server.
The listening socket is created with the following parameters
System.Net.Sockets.AddressFamily.InterNetwork
System.Net.Sockets.SocketType.Stream
System.Net.Sockets.ProtocolType.IP
We have experimented with the preceding without success.
The endpoint to which the listening socket is bound specifies the local IP address and a specific port number.
The wait-for-connection code is textbook asynchronous:
thelistener.Listen(10)
thelistener.BeginAccept(New System.AsyncCallback(AddressOf targetofaccept), thelistener)
If the client that attempts connection is on the same computer as the listener, then targetofaccept is run successfully. If the client that attempts connection is on some other computer on the network, then targetofaccept is not run.
The behavior occurs for any other client on the network (i.e., not just one).
Thinking that there was some firewall issue, we created VB6 servers and clients using the same addresses and ports. The VB6 server will receive connection requests regardless of the client system.
There is no other issue with communication between clients and the server, as far as we can see. The network architecture has not been modified for a number of years.
We are debugging the code as a VB.NET console application.
Any tips on how to diagnose appreciated.
Before calling Listen() you need to bind your listener socket to the address 0.0.0.0 (in .NET IPAddress.Any) so that it listens to connections from any IP address.
This can be done using the Socket.Bind() method:
Dim listenerEndpoint As New IPEndPoint(IPAddress.Any, <your port>)
thelistener.Bind(listenerEndpoint)
thelistener.Listen(10)
Thank you.
Issue WAS firewall. Fixed by finding exact location of the IDE (devenv.exe), opening "Windows Firewall" in the control panel, selecting "Allow a program or feature through firewall", selecting "Allow another program...", browsing to the exact location and selecting the executable, then ensuring "Home/Work (Private)" column is checked for that "Name".

Cant connect sql server from another computer

Currently, I am using SQL server 2012 and running in window 7 64 bit.
My question is
How can I connect this server from another computer (window 10 64
bit)?
What have I done?
My server name is NB-1608-001\SQLEXPRESS2 and I already enable TCP/IP status and Name Pipes status and Shared Memory status
I already set TCP port 1433 for IP4 and IPAll.
I already enable "Allow remote connection to this server" for this server
I already enable "SQL Server and Windows Authentication mode"
The two computer are on the same network
I created UDL file in window 10 computer (I set server name to :"\NB-1608-001\SQLEXPRESS2")and try to connect to sql server but this say:
Test connection failed because of an error in initializing provider :
Unspecified error
After searching some solution on google,
I created InBound and Outbound rule for IP 1433 in Window 7 Computer
But it's still not working.
I tried another way for make sure whether this two computer is connected or not.
I typed "\NB-1608-001" in network and this said
Windows cannot access \NB-1608-001
After Diagnose,It said
file and print sharing resource (NB-1608-001) is online but isnt
responding to connection attempts.
So I assume the two computers are connected.
Is there still another solution?
My main reason is to run the c# app and connect to another computer's SQL server.
Thanks
(some notes: 1433 is a TCP port not an IP, you have to put two backslash \\ for UNC path but maybe this is a StackOverflow escape problem)
I suggest to disable the firewall just for testing purpose to all firewall profiles (maybe you set inbound rule only for private profile and your network is flagged as public).
I would try a ping to the machine name to be sure that its name is resolved by the client.
I would check in the Sql server Configuration manager that TCP client protocols is enabled for both SQL Native clients (32 and 64bit) and TCP/IP under Protocols Network Configuration.
You did not say what is your client, I would try to connect with SQL Server Management Studio, just to be sure this is not a problem related to your client.
This reading can be useful:
https://blogs.msdn.microsoft.com/sqlexpress/2005/05/05/how-to-configure-express-to-accept-remote-connections/

External Email Server for one domain under cPanel server

Trying to set up a domain name under cPanel server... so far so good, the problem comes once I am trying to point this domain to an external Kerio Mail server.
Even though from ssh user root can telnet the Kerio Mail server, when the user/domain tries to sent email using this server, get's smtp connection timed out.
Wondering is there's more than DNS changes that need to be made or something else is needed in cPanel firewall (CSF)
To allow SMTP connection to another server, any thoughts ?
If you are trying to send mail from your server and getting timeout then you need to check your firewall. First I will suggest you please try to disable your server firewall and test your mail again.

Domino agent - Remote server is not a known TCP/IP host

I have a Domino development server I can't get web-based emails to send from. The error I'm getting is "The remote server is not a known TCP/IP host". The server works fine for Notes based emails, but I'm generating emails from LotusScript in an app, and they are not sending.
This server was recently created (Dom 8.5.3).
I have the server sending email directly to the Internet on all location documents (for Notes client).
See IBM Technote #1099632 "Notes/Domino background agent fails to send mail; Errors may occur in logs":
These errors may be caused by an improper entry for the Mail Server field in the Server document in the Domino Directory (public Name and Address Book).
The errors may also be caused by a server configuration or TCPIP issue. For example, if the Network Address field for a TCPIP port contains either an incorrect host name or an IP address, the errors occur. If the DNS is not working correctly the errors will occur.
The issue was noted in at least one case because the server was resolvable by IP address but not resolvable by Fully Qualified Host Name (FQHN). The IP address was listed in the Net Address field of the Server document but this error message still appeared. To resolve this issue, update the DNS servers to point the FQHN to the correct server. In one case it was discovered that the particular Domino server was not listed in its own host table. Update the host file of the server with the FQHN pointing to its own IP or localhost address.
The Technote also provides steps to troubleshoot the issue.
Also, you can enable some debugging to determine where the problem surfaces.
For outbound SMTP-related issues, enable the debug parameters below on the server to capture data:
CONSOLE_LOG_ENABLED=1
DEBUG_THREADID=1
debug_show_timeout=1
debug_capture_timeout=1
SMTPClientDebug=1
See Collecting data for Domino SMTP mail routing issues for more details on that

page cannot display error on client system

I'm using windows server 2008 & IIS 7.0 to deploy the my vb.net 3.5 application.
I'm successfully able to run the URL on my server.
Same URL having IP address & port number configured is not working on client system.
It is showing IE default error message as "page cannot display"
Thanks
A couple of things to do:
Try it in something other than IE - Or at the very least turn off IE "Friendly http error messages" as they obscure the real problem (Tools -> Internet Options -> Advanced)
Make sure the IIS website is bound to all IP Addresses not just 127.0.0.1 (localhost)
Make sure the windows firewall / other firewalls in use are configured to allow incoming traffic on port 80 through (assuming you're using port 80)
Check the event logs - If it's a coding problem, the error message is usually dumped in there
If the client system is on a different network, make sure that all your firewalls/routers are set up to allow the appropriate traffic through
Some more information which would help us:
Where (in network terms) is the client you mention? same network?
What happen if you use the full URL the client's using from a browser on the server?
When you say it works on your server, is that the VS development server? or the same server the client is using?