Solved

SMTP via .NET program failure

Posted on 2015-02-19
1
75 Views
Last Modified: 2016-02-04
I have a program that handles vacation/sick requests which was recently moved from Server 2003 (IIS 6) to a new Server 2008 (IIS 7.5)

The notification email for when a user requests absence is no longer functioning.
 - It does however work for domain administrators!

I can ping and Telnet to the SMTP server which led me to believe it was a permission issue.
-I tried creating a new mailbox (Requests@domain) with everyone having full access permission
-I created a new receive connector allowing anonymous connection from the server IP




The program (SMTP Piece):

Dim email As New System.Net.Mail.MailMessage()
Dim client As New SmtpClient
client.UseDefaultCredentials = False
client.Credentials = New System.Net.NetworkCredential("username", "password")
client.DeliveryMethod = SmtpDeliveryMethod.Network
client.Host = AppSettings("SmtpServer")
email.From = New MailAddress("username@domain.com")
email.From = New MailAddress(AppSettings("EmailFrom"))
----------------------------------------------------------------------------------------------------------------------



This is the output if the user is not a domain admin:

[SocketException (0x277b): A system call has failed ***.***.***.***:25]
   System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +273
   System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception) +584

[WebException: Unable to connect to the remote server]
   System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6) +8593522
   System.Net.PooledStream.Activate(Object owningObject, Boolean async, GeneralAsyncDelegate asyncCallback) +8593954
   System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) +3016971
   System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint) +286
   System.Net.Mail.SmtpClient.Send(MailMessage message) +1500

[SmtpException: Failure sending mail.]
   System.Net.Mail.SmtpClient.Send(MailMessage message) +2392407
   GlobalFunctions.error_email(String txtst, String txtmsg, String user) in C:\inetpub\wwwroot\Intranet\Requests\App_Code\GlobalFunctions.vb:114
   _Default.btnSubmit_Click(Object sender, EventArgs e) in C:\inetpub\wwwroot\Intranet\Requests\Users\Users.aspx.vb:401
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +155
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3804
0
Comment
Question by:RISLA
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 26

Accepted Solution

by:
Shaun Kline earned 500 total points
ID: 40621093
Is the application pool for your web application running under the same credentials as was on the old server? From the error, it sounds more like the web application itself does not have permissions to access resources on your mail server.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
API v SOA 8 38
asp.net uploading picture to a temporary folder 4 25
Upgrade code from VS 2010 to VS 2015 7 32
ASP.NET data base connection 35 31
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question