locked
SharePoint Workflow Custom Code Activity Error RRS feed

  • Question

  • I have a SharePoint custom activity which consists a default custom code activity within the custom code i have code as below:

                   

    private void ExecuteSendEmail(object sender, EventArgs e)       

    {                       

    if (!string.IsNullOrEmpty(To))           

    {               

    System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();               

    message.To.Add(To);               

    message.Subject = Subject;               

    .From = new System.Net.Mail.MailAddress(From);               

    message.Body = Body;               

    System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient(SMTP);               

    smtp.Send(message);           

    }       

    }


    The code is working fine until lately user complaints that they are not receiving any email. I have found the error stack trace as below:

    Failure sending mail.:    at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout)
       at System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback)
       at System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback)
       at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout)
       at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port)
       at System.Net.Mail.SmtpClient.Send(MailMessage message)

    Seem to me it is more on email issue rather than workflow but appreciate if anyone can enlighten me by telling me what's may be went wrong.

     
    • Edited by d3ric3 Friday, March 2, 2012 5:31 PM
    Friday, March 2, 2012 5:30 PM

Answers

  • It happened that my customer IT department has changed the IP of their email server. Nothing is wrong with the code. 
    • Edited by d3ric3 Thursday, June 21, 2012 6:15 AM
    • Marked as answer by d3ric3 Thursday, June 21, 2012 6:15 AM
    Thursday, June 21, 2012 6:14 AM

All replies

  • Hi d3ric3,

    I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.

    Thanks


    Daniel Yang

    TechNet Community Support

    Tuesday, March 6, 2012 9:48 AM
    Moderator
  • Hi there,

    I suggest that you post this issue to this forum:

    http://social.technet.microsoft.com/Forums/en-US/w7itpronetworking/threads

    Call stack indicates a network socket error and not an issue with your workflow.

    Gregg


    MSFT

    Friday, March 23, 2012 3:10 PM
    Moderator
  • It happened that my customer IT department has changed the IP of their email server. Nothing is wrong with the code. 
    • Edited by d3ric3 Thursday, June 21, 2012 6:15 AM
    • Marked as answer by d3ric3 Thursday, June 21, 2012 6:15 AM
    Thursday, June 21, 2012 6:14 AM