• karen.scott260 (11/4/2010)


    When I try to execute the sp in SQL this is the error that I get. Does anyone know what the problem could be?

    Msg 6522, Level 16, State 1, Procedure p_SendEMail, Line 0

    A .NET Framework error occurred during execution of user-defined routine or aggregate "p_SendEMail":

    System.NullReferenceException: Object reference not set to an instance of an object.

    System.NullReferenceException:

    at SQLCLREmail.SendEmail(String recipients, String CC, String BCC, String subject, String from, String body, String strAttachments, String strSMTPServer, String strSMTPServerPort, String strSMTPServerUser, String strSMTPServerPwd)

    .

    Check the values that are being passed in with profiler or something to make sure they have a value and are not null.

    For example make sure that you are passing in a from, recipents, body, smtpserver, port user and password.