Hi,
To add the user IP address to the contact mail, you must create a small module and use the hook hook_mail_alter(&$message)
. (See How to create a module in Drupal 8 with Hook)
Example (not tested)
function mymodule_mail_alter(&$message) {
if ($message['id'] == 'contact_user_mail' || $message['id'] == 'contact_user_copy') {
// Add the visitor IP address at the end of the contact mail body
$ip = \Drupal::request()->getClientIp();
$message['body'][] = "--\nUser IP Address : $ip ";
}
}