Almost, though I tend to prefer:
$this->from = "From: " . $_POST['visitormail'] . "\r\n";
The "almost" is because you probably want to use $this->from instead of $from since you mentioned attribute. Anyway, read the PHP manual on the string type for more information.