Solved

SMTP via .NET program failure

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now