I am trying to send attachment when I submit a webform using Mime Mail mailer as a formatter and PHPMailer SMTP as sender in Mail System. When I include PDF attachment on the email, I get this error message:
The website encountered an unexpected error. Please try again later. ValueError: realpath(): Argument #1 ($path) must not contain any null bytes in realpath() (line 139 of core/lib/Drupal/Core/File/FileSystem.php).**
Here is what’s in line 139
public function realpath($uri) { // If this URI is a stream, pass it off to the appropriate stream wrapper. // Otherwise, attempt PHP's realpath. This allows use of this method even // for unmanaged files outside of the stream wrapper interface. if ($wrapper = $this->streamWrapperManager->getViaUri($uri)) { return $wrapper->realpath(); //line 139 } return realpath($uri); }
I have never changed anything since I installed the module. What is going wrong in here?