Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SMTP via .NET program failure

Posted on 2015-02-19
1
Medium Priority
?
116 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 27

Accepted Solution

by:
Shaun Kline earned 2000 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

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…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

610 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