<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def post(self, request, *args, **kwargs):
 """ Contact node owner. """

        try:
            self.get_object(**kwargs)
        except Http404:
            return Response({'detail': _('Not Found')}, status=404)

        if not self.is_contactable():
            return Response({'detail': _('This resource cannot be contacted')}, status=400)

        content_type = ContentType.objects.only('id', 'model').get(model=self.content_type)
        # shortcut
        data = request.data
        # init inward message
        message = Inward()
        # required fields
        message.content_type = content_type
        message.object_id = self.recipient.id
        message.message = data.get('message')
        # user info if authenticated
        if request.user.is_authenticated():
            message.user = request.user
        else:
            message.from_name = data.get('from_name')
            message.from_email = data.get('from_email')
        # additional user info
        message.ip = request.META.get('REMOTE_ADDR', '')
        message.user_agent = request.META.get('HTTP_USER_AGENT', '')
        message.accept_language = request.META.get('HTTP_ACCEPT_LANGUAGE', '')
        try:
            message.full_clean()
        except ValidationError, e:
            return Response(e.message_dict, status=400)
        message.save()

        if message.status >= 1:
            return Response({'details': _('Message sent successfully')}, status=201)
        else:
            return Response({'details': _('Something went wrong. The email was not sent.')}, status=500)