Solved

SMTP via .NET program failure

Posted on 2015-02-19
1
88 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

705 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